Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
HTML Articles
Page 128 of 151
What is the usage of onreset event in JavaScript?
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 Moreimg-rounded Bootstrap class
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 MoreWhat is the usage of onsearch event in JavaScript?
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 MoreWrap Strings of Text in Bootstrap Navbar
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 MoreWhich event occurs in JavaScript when an element's content is cut?
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 MoreBootstrap Labels
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 MoreWhat is the role of clientX Mouse Event in JavaScript?
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 MoreSharedArrayBuffer.byteLength Property in JavaScript
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 MoreHow -Infinity is converted to Number in JavaScript?
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 MoreTypedArray.buffer property in JavaScript
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