AmitDiwan

AmitDiwan

8,392 Articles Published

Articles by AmitDiwan

Page 255 of 840

HTML ondrag Event Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 230 Views

The ondrag event attribute in HTML is triggered continuously while an element is being dragged. This event fires repeatedly during the drag operation, making it useful for providing real-time feedback or updating the interface while dragging is in progress. By default, HTML images and links are draggable without requiring the draggable="true" attribute. For other elements like , , or , you must explicitly set draggable="true" to make them draggable. Syntax Following is the syntax for the ondrag event attribute − Content Parameters script − JavaScript code to execute when the element ...

Read More

HTML DOM Input Range value property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 1K+ Views

The HTML DOM Input Range value property is associated with input elements having type="range". It returns or sets the current value of the range slider control. The value can be the default value specified in HTML or a value set by the user dragging the slider. Syntax Following is the syntax for getting the value property − var value = rangeObject.value; Following is the syntax for setting the value property − rangeObject.value = number; Here, number is a numeric value within the range defined by the min and max attributes ...

Read More

HTML DOM Video ended Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 219 Views

The HTML DOM Video ended property returns a boolean value indicating whether a video has finished playing. It returns true when the video has reached its end, and false otherwise. This property is read-only and useful for detecting when video playback is complete. Syntax Following is the syntax for accessing the ended property − videoElement.ended Return Value The ended property returns a Boolean value − true − The video has reached its end false − The video is still playing or paused before the end Example − Checking Video ...

Read More

HTML isTrusted Event Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 189 Views

The isTrusted event property is a read-only boolean property that indicates whether an event was triggered by a user action or programmatically by a script. This property is crucial for security purposes, allowing developers to distinguish between genuine user interactions and automated script-generated events. When an event is triggered by genuine user actions like clicks, keystrokes, or mouse movements, the isTrusted property returns true. However, when the same event is generated programmatically using JavaScript methods like click(), dispatchEvent(), or similar functions, it returns false. Syntax Following is the syntax to access the isTrusted property from an event ...

Read More

HTML oninput Event Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 427 Views

The oninput event attribute in HTML is triggered when the user enters or modifies input in form elements such as , , and elements. Unlike onchange, which fires only when the element loses focus, oninput fires immediately as the user types or modifies content. Syntax Following is the syntax for the oninput event attribute − Where script is the JavaScript code or function to execute when the input event occurs. Using oninput with Textarea The oninput event is commonly used with elements to provide real-time feedback as users type. ...

Read More

HTML DOM Video height Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 189 Views

The HTML DOM Video height property gets or sets the height of a video element in pixels. This property corresponds to the height attribute of the element and allows dynamic resizing of video content through JavaScript. Syntax Following is the syntax for getting the height property − mediaObject.height Following is the syntax for setting the height property − mediaObject.height = number Parameters The height property accepts the following parameter − number − A numeric value representing the height of the video element in pixels. The value ...

Read More

HTML DOM Fieldset Object

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 217 Views

The HTML DOM Fieldset object represents the HTML element, which groups related form controls and labels. This object provides properties and methods to dynamically create, access, and manipulate fieldset elements using JavaScript. The element is commonly used to group form inputs, checkboxes, radio buttons, and other controls together with an optional element that provides a caption for the group. Syntax Following is the syntax for creating a fieldset element using JavaScript − var fieldsetElement = document.createElement("FIELDSET"); To access an existing fieldset element by its ID − var fieldsetElement ...

Read More

HTML DOM Table caption Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 207 Views

The HTML DOM table caption property is used to get or set the caption of an HTML table element. The caption provides a title or description for the table content and is typically displayed above the table. Syntax Following is the syntax for getting the caption property − tableObject.caption Following is the syntax for setting the caption property − tableObject.caption = captionObject Property Values The caption property accepts the following values − captionObject − A reference to the caption element object, or null if no caption exists. ...

Read More

HTML oninvalid Event Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 327 Views

The HTML oninvalid event attribute is triggered when an input field fails validation while submitting a form. This event occurs when form elements with validation constraints (like required, pattern, or type-specific validation) contain invalid data. Syntax Following is the syntax for the oninvalid event attribute − The script parameter contains JavaScript code that executes when the element becomes invalid during form submission. How It Works The oninvalid event fires when: A required field is empty during form submission An input value doesn't match the specified pattern An email input ...

Read More

HTML DOM Video load( ) Method

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 248 Views

The HTML DOM Video load() method is used to reload the video element after modifying its attributes such as the src or playback settings. When properties like defaultPlaybackRate, src, or video sources are changed, calling load() re-initializes the video element to apply these changes. Syntax Following is the syntax for the Video load() method − videoObject.load() Parameters The load() method takes no parameters. Return Value The method does not return any value. It simply reloads the video element with the updated attributes. When to Use load() Method The load() ...

Read More
Showing 2541–2550 of 8,392 articles
« Prev 1 253 254 255 256 257 840 Next »
Advertisements