Prabhas

Prabhas

52 Articles Published

Articles by Prabhas

Page 2 of 6

Convert text to uppercase with CSS

Prabhas
Prabhas
Updated on 15-Mar-2026 2K+ Views

To convert text to uppercase with CSS, use the text-transform property with the value uppercase. This property transforms the visual appearance of text without modifying the actual content. Syntax text-transform: uppercase; Example Here's how to convert text to uppercase using CSS: .uppercase-text { text-transform: uppercase; } ...

Read More

What is the best way to initialize a JavaScript number?

Prabhas
Prabhas
Updated on 15-Mar-2026 816 Views

The best way to initialize a number in JavaScript is to assign a value during variable declaration. This approach prevents undefined values and ensures your variables are ready to use immediately. Basic Number Initialization You can initialize numbers using various declaration keywords: Number Initialization // Initialize with var var deptNum = 20; var employeeId = 5; // Note: ...

Read More

How to create JavaScript alert with 3 buttons (Yes, No and Cancel)?

Prabhas
Prabhas
Updated on 15-Mar-2026 4K+ Views

The standard JavaScript alert box won't work if you want to customize it. For that, we have a custom alert box, which we're creating using jQuery and styled with CSS. Understanding the Problem JavaScript's built-in alert() and confirm() functions are limited - they only provide basic "OK" or "OK/Cancel" options. To create a custom dialog with Yes, No, and Cancel buttons, we need to build our own solution using HTML, CSS, and JavaScript. Complete Example Here's a complete implementation of a custom alert with three buttons: ...

Read More

Generating sound on the fly with JavaScript/ HTML5

Prabhas
Prabhas
Updated on 15-Mar-2026 457 Views

The Web Audio API is used to control audio, which allows you to choose audio sources. You can also add effects, create audio visualizations, panning, and generate sounds programmatically in web browsers. Basic Sound Generation To generate sound with the Web Audio API, you need three main components: an AudioContext, an oscillator (sound source), and a destination (speakers). Here's how to create a simple tone: Generate Sound Play 500Hz Tone ...

Read More

Working with Inline CSS

Prabhas
Prabhas
Updated on 15-Mar-2026 438 Views

Inline CSS allows you to apply styles directly to HTML elements using the style attribute. This method applies styles to individual elements only, making it useful for quick styling or element-specific customizations. Syntax You can use the style attribute on any HTML element to define inline style rules: Style Attribute Attribute Value ...

Read More

How can I trigger a JavaScript click event?

Prabhas
Prabhas
Updated on 15-Mar-2026 2K+ Views

In JavaScript, you can programmatically trigger a click event on an element using the click() method. This is useful for automating user interactions or creating custom behaviors. Using the click() Method The click()

Read More

What are generator functions in JavaScript?

Prabhas
Prabhas
Updated on 15-Mar-2026 351 Views

Generator functions in JavaScript allow you to pause and resume function execution, providing powerful control over program flow. Unlike regular functions that run to completion, generators can yield values multiple times and maintain their internal state between calls. Syntax Generator functions are defined using the function* syntax with an asterisk. The asterisk can be placed in different positions: function* myGenerator() {} // or function *myGenerator() {} // or function*myGenerator() {} How Generator Functions Work Generator functions use the yield keyword to pause execution and return a value. When called, they return a generator ...

Read More

With CSS set the element to retain the style values that are set by the last keyframe

Prabhas
Prabhas
Updated on 15-Mar-2026 229 Views

The CSS animation-fill-mode property with the forwards value is used to retain the style values that are set by the last keyframe when the animation completes. This prevents the element from reverting to its original state after the animation ends. Syntax selector { animation-fill-mode: forwards; } Example The following example demonstrates how an element retains the final animation state using animation-fill-mode: forwards − .animated-box { ...

Read More

Add space inside a form's text field with CSS

Prabhas
Prabhas
Updated on 15-Mar-2026 10K+ Views

To add space inside a form's text field, use the CSS padding property. This creates internal spacing between the text and the field's border, making the input more visually appealing and easier to read. Syntax input[type="text"] { padding: value; } Example: Adding Space Inside Text Fields The following example demonstrates how to add internal spacing to text input fields − input[type="text"] { width: 100%; ...

Read More

CSS3 Multi color Gradients

Prabhas
Prabhas
Updated on 15-Mar-2026 260 Views

CSS3 multi-color gradients allow you to create smooth transitions between multiple colors in a single gradient. Unlike simple gradients that use only two colors, multi-color gradients can include three or more colors to create vibrant, complex color effects. Syntax selector { background: linear-gradient(direction, color1, color2, color3, ...); } Example The following example demonstrates a multi-color linear gradient with seven colors − #grad { height: 100px; ...

Read More
Showing 11–20 of 52 articles
Advertisements