Execute a script when the cue changes in a element in HTML?

Chandu yadav
Updated on 16-Mar-2026 21:38:53

186 Views

The oncuechange event attribute executes a script when the active cue changes in a element. This event is particularly useful for video and audio elements that use text tracks for subtitles, captions, or descriptions. The oncuechange event fires whenever the browser switches from one cue to another in a text track, allowing developers to respond to subtitle changes, implement custom subtitle styling, or trigger other actions based on the current cue. Syntax Following is the syntax for the oncuechange attribute − Where script is the JavaScript code to execute when the ... Read More

How do we set the range that is considered to be of low value in HTML?

Yaswanth Varma
Updated on 16-Mar-2026 21:38:53

264 Views

The low attribute in HTML defines the range that is considered to be of low value in a gauge. It works exclusively with the element to set the threshold below which values are considered low. The low attribute helps browsers visually indicate when a meter's value falls within the low range, typically by changing the gauge's color or appearance. Note − The low attribute can only be used with the tag. Syntax Following is the syntax for the low attribute − Content Parameters The low attribute accepts the following parameter ... Read More

HTML DOM Input Month required Property

Sharon Christine
Updated on 16-Mar-2026 21:38:53

157 Views

The HTML DOM Input Month required property is used to set or return whether a month input field must be filled out before submitting a form. This property corresponds to the HTML required attribute and provides client-side validation for month input elements. Syntax Following is the syntax for getting the required property − object.required Following is the syntax for setting the required property − object.required = true | false Property Values The required property accepts the following boolean values − true − The month input field is ... Read More

How to specify that the audio/video will start over again, every time it is finished in HTML?

V Jyothi
Updated on 16-Mar-2026 21:38:53

411 Views

Use the loop attribute to specify that the audio/video will start over again every time it is finished. The loop attribute is a boolean attribute that, when present, causes the media to automatically restart from the beginning once it reaches the end. Syntax Following is the syntax for the loop attribute − For audio elements − Using Loop with Video Element The loop attribute works with the HTML5 element to create continuous playback. When the video ... Read More

How can I invoke encodeURIComponent from AngularJS template in HTML?

Yaswanth Varma
Updated on 16-Mar-2026 21:38:53

565 Views

The encodeURIComponent() function is a JavaScript method that encodes special characters in URI components by replacing them with UTF-8 escape sequences. In AngularJS templates, you can invoke this function through controller methods, filters, or direct expressions to safely encode URLs, query parameters, and other URI components. Each time a special character appears in a URI component, the encodeURIComponent() function replaces it with one, two, three, or four escape sequences representing the character's UTF-8 encoding (four escape sequences are used for characters composed of two "surrogate" characters). Syntax Following is the syntax for encodeURIComponent() − encodeURIComponent(uriComponent) ... Read More

HTML DOM Input Month step Property

Sharon Christine
Updated on 16-Mar-2026 21:38:53

180 Views

The HTML DOM Input Month step property is used to get or set the value of the step attribute for an input element of type month. The step attribute specifies the legal number intervals for month values, controlling how the month picker increments or decrements when using the arrow controls. When you set a step value, the month input will only accept values that are multiples of that step from the minimum value. For example, with step="3", the input will increment by 3 months at a time. Syntax Following is the syntax for returning the step value ... Read More

How to use HTML5 localStorage and sessionStorage?

Nancy Den
Updated on 16-Mar-2026 21:38:53

670 Views

HTML5 introduced two powerful mechanisms for storing data on the client side − localStorage and sessionStorage. These storage options overcome the limitations of traditional HTTP cookies by providing larger storage capacity and reducing unnecessary data transmission with every HTTP request. The key advantages of HTML5 web storage over cookies include − No automatic transmission − Storage data is not sent with every HTTP request, improving web application performance. Larger storage capacity − Web storage can hold approximately 5-10 MB of data per domain, compared to cookies' 4 KB limit. Better performance − ... Read More

HTML DOM Anchor password Property

Ankith Reddy
Updated on 16-Mar-2026 21:38:53

170 Views

The HTML DOM Anchor password property sets or returns the password portion of an anchor element's href attribute value. This property is part of the URL structure that includes user credentials in the format https://username:password@hostname.com. Syntax To set the password property − anchorObject.password = "newPassword" To return the password property − anchorObject.password Return Value The password property returns a string representing the password part of the URL. If no password is specified in the href attribute, it returns an empty string. Example − Getting Anchor Password Following ... Read More

How do we add the maximum number of characters allowed in an element in HTML?

Yaswanth Varma
Updated on 16-Mar-2026 21:38:53

438 Views

In HTML, the maxlength attribute is used to limit the maximum number of characters that can be entered in an input field or textarea element. This attribute helps control user input and ensures data consistency in forms by preventing users from entering more characters than allowed. Syntax Following is the syntax for the maxlength attribute − Following is the syntax for textarea elements − Here, number represents the maximum number of characters allowed. The value must be a non-negative integer. Basic Usage with Input Fields The ... Read More

Execute a script when the dragged element is being dropped in HTML?

Yaswanth Varma
Updated on 16-Mar-2026 21:38:53

417 Views

The ondrop event in HTML is triggered when a dragged element or text selection is dropped onto a valid drop target. This event is essential for implementing drag and drop functionality, allowing users to move elements between different areas of a webpage. The ondrop event works in conjunction with other drag events like ondragstart, ondragover, and ondrag to create a complete drag and drop experience. Syntax Following is the syntax for the ondrop event − content The ondrop event handler receives an event object that contains information about the drag operation, including the ... Read More

Advertisements