HTML Articles

Page 128 of 151

What is the usage of onreset event in JavaScript?

Anjana
Anjana
Updated on 15-Mar-2026 442 Views

The onreset event is triggered when a form is reset using a reset button or the reset() method. This event allows you to execute JavaScript code when users clear form data. Syntax // form elements // Or using addEventListener form.addEventListener('reset', functionName); Example: Basic onreset Event onreset Event Example function resetFunct() { alert("The form was ...

Read More

img-rounded Bootstrap class

George John
George John
Updated on 15-Mar-2026 348 Views

Use the img-rounded Bootstrap class to style your image and give it rounded corners. This class applies CSS border-radius to create smooth, rounded edges on images. Syntax Example Bootstrap Images Styling Images with Bootstrap ...

Read More

What is the usage of onsearch event in JavaScript?

Abhinanda Shri
Abhinanda Shri
Updated on 15-Mar-2026 412 Views

The onsearch event triggers when a user interacts with a search input field by pressing ENTER or clicking the "x" (clear) button. This event only works with elements and provides a convenient way to handle search operations. Syntax // Or using addEventListener element.addEventListener("search", myFunction); Example Here's how to implement the onsearch event to capture user search input: OnSearch Event Example Write what you want to search below and press "ENTER" or click the "x" to clear: ...

Read More

Wrap Strings of Text in Bootstrap Navbar

Ankith Reddy
Ankith Reddy
Updated on 15-Mar-2026 643 Views

To wrap strings of text in a Bootstrap navbar, use the .navbar-text class. This class ensures proper vertical alignment and styling for non-link text content within navigation bars. What is navbar-text? The .navbar-text class is specifically designed for adding non-interactive text elements to Bootstrap navbars. It provides appropriate spacing, alignment, and color styling that matches the navbar's design. Example You can try to run the following code to set text in Bootstrap Navbar: Bootstrap Navbar Text Example ...

Read More

Which event occurs in JavaScript when an element's content is cut?

V Jyothi
V Jyothi
Updated on 15-Mar-2026 188 Views

The oncut event occurs when an element's content is cut using Ctrl+X or the right-click context menu. This event is commonly used with input fields, textareas, and other editable elements to track when users cut text. Syntax element.oncut = function() { // Code to execute when content is cut }; // Or using addEventListener element.addEventListener('cut', function(event) { // Code to execute when content is cut }); Example: Basic oncut Event Cut Event Example ...

Read More

Bootstrap Labels

Samual Sam
Samual Sam
Updated on 15-Mar-2026 223 Views

Labels are great for offering counts, tips, or other markups for pages. Bootstrap provides the .label class to create inline labels that complement text content. Basic Label Syntax Use the .label class along with contextual classes to create different styled labels: Default Primary Success Example Here's a complete example showing labels used with headings to display counts: Bootstrap Labels Example ...

Read More

What is the role of clientX Mouse Event in JavaScript?

Nancy Den
Nancy Den
Updated on 15-Mar-2026 457 Views

The clientX property returns the horizontal (x-axis) coordinate of the mouse pointer relative to the current viewport when a mouse event occurs. Unlike other coordinate properties, clientX is measured from the left edge of the browser's visible area, not including scrollbars. Syntax event.clientX Return Value Returns a number representing the horizontal pixel position of the mouse pointer relative to the viewport's left edge. Example: Getting Mouse Coordinates on Click clientX Mouse Event ...

Read More

SharedArrayBuffer.byteLength Property in JavaScript

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 126 Views

The byteLength property of the SharedArrayBuffer returns an unsigned, 32-bit integer that specifies the size/length of a SharedArrayBuffer in bytes. Syntax sharedArrayBuffer.byteLength Parameters This property takes no parameters and is read-only. Return Value Returns the length of the SharedArrayBuffer in bytes as a 32-bit unsigned integer. Example JavaScript Example var sharedArrayBuffer = new SharedArrayBuffer(8); ...

Read More

How -Infinity is converted to Number in JavaScript?

Monica Mona
Monica Mona
Updated on 15-Mar-2026 282 Views

In JavaScript, -Infinity is a special numeric value representing negative infinity. When converted using the Number() method, it remains -Infinity since it's already a valid number type. Understanding -Infinity -Infinity is a built-in JavaScript constant that represents the mathematical concept of negative infinity. It's already of type "number", so converting it with Number() simply returns the same value. -Infinity Conversion Converting -Infinity to Number var myVal = -Infinity; ...

Read More

TypedArray.buffer property in JavaScript

Samual Sam
Samual Sam
Updated on 15-Mar-2026 107 Views

The buffer property of TypedArray instances provides access to the underlying ArrayBuffer object that stores the binary data for the typed array. Syntax typedArray.buffer Return Value Returns the ArrayBuffer object that backs the TypedArray instance. Example JavaScript Example var buffer = new ArrayBuffer(156); var float32 = new Float32Array(buffer); document.write("Buffer byte length: " + float32.buffer.byteLength); ...

Read More
Showing 1271–1280 of 1,509 articles
« Prev 1 126 127 128 129 130 151 Next »
Advertisements