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
Articles by AmitDiwan
Page 253 of 840
HTML DOM Input Range step property
The HTML DOM Input Range step property is used to set or return the step attribute value of a range slider control. It specifies the increment value for each movement of the slider. By combining the step property with min and max attributes, you can define precise intervals for legal values within the range. Syntax Following is the syntax for setting the step property − rangeObject.step = number Following is the syntax for returning the step property − rangeObject.step Parameters The step property accepts the following parameter − ...
Read MoreHTML onblur Event Attribute
The onblur event attribute in HTML is triggered when an element loses focus. This commonly occurs when a user clicks away from an input field, button, or other focusable element, or when they press the Tab key to navigate to another element. Syntax Following is the syntax for the onblur event attribute − Content The script parameter contains JavaScript code that executes when the element loses focus. Common Use Cases The onblur event is commonly used in the following scenarios − Form validation − Validate input fields when users move ...
Read MoreHTML Window self Property
The HTML Window self property returns a reference to the current window object. It is essentially the same as the global window object and is commonly used to check if the current window is the topmost window or if it's embedded within a frame or iframe. Syntax Following is the syntax for accessing the window self property − window.self The window.self property returns the window object itself, making it equivalent to simply using window. Return Value The window.self property returns the current window object reference. Common Use Cases The window ...
Read MoreHTML onclick Event Attribute
The onclick event attribute in HTML is triggered when a user clicks on an HTML element. It allows you to execute JavaScript code in response to mouse clicks, making web pages interactive and dynamic. Syntax Following is the syntax for the onclick event attribute − Content Where script can be either a JavaScript function call or inline JavaScript code that executes when the element is clicked. Basic Example Following example demonstrates a simple onclick event that displays an alert message − Basic onclick Example ...
Read MoreHTML Window sessionStorage Property
The HTML Window sessionStorage property allows us to store key/value pairs data in a web browser for one session only. The data is automatically deleted when the browser tab is closed, making it perfect for temporary data storage during a user's visit. The sessionStorage is part of the Web Storage API and provides a way to store data locally within the user's browser with session-level persistence. Unlike localStorage, sessionStorage data does not persist across browser sessions. Syntax Following is the syntax to access the sessionStorage object − window.sessionStorage SessionStorage Methods The sessionStorage ...
Read MoreHTML DOM exitFullscreen() method
The HTML DOM exitFullscreen() method is used to exit fullscreen mode for an element that is currently displayed in fullscreen. This method is called on the document object, not on individual elements, and it returns a Promise that resolves when the element has exited fullscreen mode. Syntax Following is the syntax for the exitFullscreen() method − document.exitFullscreen() Return Value The method returns a Promise that resolves to undefined when fullscreen mode is successfully exited. The Promise may be rejected if an error occurs during the exit process. How It Works The ...
Read MoreHTML DOM Input Range stepDown() method
The HTML DOM Input Range stepDown() method is used to decrement the value of a range slider by a specified amount. If no parameter is provided, it decrements by 1. When the step attribute is defined on the range input, the stepDown() method decrements in multiples of that step value. Syntax Following is the syntax for the Range stepDown() method − rangeObject.stepDown(number) Parameters The method accepts the following parameter − number − An optional numeric parameter specifying how many steps to decrement. If omitted, defaults to 1. How It ...
Read MoreHTML onchange Event Attribute
The onchange event attribute in HTML is triggered when the value of a form element changes and loses focus. This event is commonly used with form controls like input fields, select dropdowns, and textareas to execute JavaScript code when the user modifies the element's value. Syntax Following is the syntax for the onchange event attribute − Where script is the JavaScript code to execute when the change event occurs. Supported Elements The onchange event attribute is supported on the following HTML elements − elements (text, password, email, number, ...
Read MoreHTML DOM Video currentTime Property
The HTML DOM Video currentTime property returns or sets the current playback position of a video element in seconds. This property is commonly used to create custom video controls, implement seek functionality, or track video progress. Syntax Following is the syntax to get the current time position − mediaObject.currentTime Following is the syntax to set the current time position − mediaObject.currentTime = seconds Parameters seconds − A numeric value representing the time position in seconds where you want to set the playback position. The value should be within the ...
Read MoreHTML DOM Fieldset disabled property
The HTML DOM Fieldset disabled property controls whether form elements inside a fieldset are enabled or disabled. When set to true, all form controls within the fieldset become disabled and appear greyed out. Users cannot interact with disabled elements − they cannot click, type, or select them. Syntax Following is the syntax to set the disabled property − fieldsetObject.disabled = true|false Following is the syntax to return the disabled property − fieldsetObject.disabled Where fieldsetObject is a reference to a fieldset element obtained using methods like getElementById() or querySelector(). Parameters ...
Read More