Execute a script when an element's scrollbar is being scrolled in HTML?

usharani
Updated on 16-Mar-2026 21:38:53

246 Views

When an element's scrollbar is being scrolled, the onscroll event attribute triggers and executes a specified JavaScript function. This event fires when the user scrolls within an element that has scrollable content, making it useful for creating interactive scroll-based behaviors. Syntax Following is the syntax for the onscroll event attribute − Content Alternatively, you can add the scroll event listener using JavaScript − element.addEventListener('scroll', functionName); How It Works The onscroll event fires whenever the scrollTop or scrollLeft property of an element changes due to user interaction. This includes scrolling ... Read More

HTML DOM Input Email form Property

AmitDiwan
Updated on 16-Mar-2026 21:38:53

151 Views

The HTML DOM Input Email form property is a read-only property that returns a reference to the form element that contains the input email field. This property provides access to the parent form element, allowing you to retrieve form attributes and manipulate form behavior through JavaScript. Syntax Following is the syntax for accessing the form property − inputEmailObject.form This property returns a reference to the HTMLFormElement object that contains the email input field. If the input field is not inside a form, it returns null. Return Value The form property returns − ... Read More

How to use an HTML tag inside HTML table?

Lokesh Badavath
Updated on 16-Mar-2026 21:38:53

7K+ Views

HTML allows you to place any valid HTML tag inside table cells, making tables highly flexible for displaying structured content. The HTML tags should be placed inside (table data) or (table header) elements to create rich, formatted content within your tables. Syntax Following is the syntax to use HTML tags inside table cells − Content You can include paragraphs, lists, images, links, forms, or any other HTML element inside table cells. The nested tags follow the same rules as regular HTML elements. Using Paragraph Tags in ... Read More

Execute a script when a reset button in a form is clicked in HTML?

Govinda Sai
Updated on 16-Mar-2026 21:38:53

309 Views

The onreset attribute in HTML is an event handler that executes a JavaScript function when a form's reset button is clicked. This attribute is applied to the element and triggers before the form fields are actually reset to their default values. Syntax Following is the syntax for using the onreset attribute − The onreset attribute calls the specified JavaScript function when the user clicks the reset button or programmatically resets the form. Basic Example Following example demonstrates how to execute a ... Read More

HTML DOM Input Email maxLength Property

AmitDiwan
Updated on 16-Mar-2026 21:38:53

159 Views

The HTML DOM Input Email maxLength property controls the maximum number of characters allowed in an email input field. This property returns or sets the maximum character limit for user input and returns -1 if no limit is defined. Syntax Following is the syntax for returning the maxLength property − inputEmailObject.maxLength Following is the syntax for setting the maxLength property − inputEmailObject.maxLength = number Parameters The number parameter represents a positive integer specifying the maximum number of characters allowed in the email input field. Setting it to -1 removes ... Read More

How to create an ordered list in HTML?

Lokesh Badavath
Updated on 16-Mar-2026 21:38:53

4K+ Views

An ordered list is a numbered list of items that displays content in a sequential, numbered format. It allows you to control the numbering sequence and group related items in a structured manner. HTML provides the tag to create ordered lists, with each item defined using the tag. The element automatically numbers each list item, starting from 1 by default. You can customize the numbering style using the type attribute to display numbers, letters, or Roman numerals. Syntax Following is the basic syntax to create an ordered list in HTML − ... Read More

Why do we use the novalidate attribute in HTML?

Arushi
Updated on 16-Mar-2026 21:38:53

6K+ Views

The novalidate attribute in HTML is a Boolean attribute that disables the browser's built-in form validation when a form is submitted. When applied to a element, it allows users to submit forms even if required fields are empty or contain invalid data according to HTML5 validation rules. This attribute is particularly useful when you want to implement custom client-side validation using JavaScript, save form progress for later completion, or handle validation entirely on the server side. Syntax Following is the syntax for the novalidate attribute − ... Read More

Execute a script when the browser window is being resized in HTML?

Daniol Thomas
Updated on 16-Mar-2026 21:38:53

351 Views

The onresize attribute in HTML executes a JavaScript function when the browser window is resized. This event is commonly used to adjust layouts, recalculate dimensions, or trigger responsive behavior when users change their window size. Syntax Following is the syntax for the onresize attribute − Content The onresize attribute is typically used on the element or object to detect when the entire browser window is resized. Using onresize with Alert Following example shows how to trigger an alert when the browser window is resized − ... Read More

HTML DOM Input Email multiple Property

AmitDiwan
Updated on 16-Mar-2026 21:38:53

289 Views

The HTML DOM Input Email multiple property controls whether an email input field can accept multiple email addresses separated by commas. When set to true, users can enter multiple valid email addresses in a single input field. Syntax Following is the syntax for getting the multiple property value − inputEmailObject.multiple Following is the syntax for setting the multiple property − inputEmailObject.multiple = boolValue Parameters The boolValue parameter can be the following − Value Description true The input email field accepts multiple ... Read More

How to create an unordered list with disc bullets in HTML?

Lokesh Badavath
Updated on 16-Mar-2026 21:38:53

5K+ Views

An unordered list in HTML displays items without numerical ordering, using bullet points instead. The element creates the list container, while elements define individual list items. By default, unordered lists use disc bullets, but you can customize the bullet style using CSS. Syntax Following is the syntax to create an unordered list with disc bullets in HTML − Item in list Item in list Item in list Since disc is the default bullet style for unordered lists, you can also create ... Read More

Advertisements