Web Development Articles

Page 19 of 801

HTML onsubmit Event Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 489 Views

The HTML onsubmit event attribute is triggered when a form is submitted in an HTML document. This attribute allows you to execute JavaScript code when a user submits a form, enabling form validation, data processing, or other custom actions before the form data is sent to the server. Syntax Following is the syntax for the onsubmit event attribute − form content The script parameter contains JavaScript code or a function call that executes when the form is submitted. The function can return false to prevent the form submission or ...

Read More

HTML onscroll Event Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 268 Views

The onscroll event attribute in HTML is triggered when an element's content is scrolled using its scrollbar. This event fires continuously as the user scrolls through the element's content, making it useful for creating dynamic scroll-based interactions and animations. The onscroll event can be applied to any HTML element that has scrollable content, including the entire document body, div containers, textarea elements, and other elements with overflow properties set to scroll or auto. Syntax Following is the syntax for the onscroll event attribute − Content Where script is the JavaScript code or function ...

Read More

HTML onsearch Event Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 168 Views

The HTML onsearch event attribute is triggered when a user presses the "Enter" key or clicks the search button (×) in an HTML input element with type="search". This event is specifically designed for search input fields and provides a way to execute JavaScript when a search action is performed. Syntax Following is the syntax for the onsearch event attribute − Where script is the JavaScript code or function to execute when the search event occurs. Parameters The onsearch event attribute accepts the following parameter − script − JavaScript code ...

Read More

HTML onselect Event Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 236 Views

The HTML onselect event attribute is triggered when a user selects text within certain HTML elements. This event works primarily with form elements that contain editable text, such as and elements. Syntax Following is the syntax for the onselect event attribute − Content Where script is the JavaScript code to execute when text selection occurs. Supported Elements The onselect event attribute works with the following HTML elements − − Single-line text input fields − Password input fields − Search input fields − Multi-line text ...

Read More

HTML onwheel Event Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 179 Views

The onwheel event attribute in HTML is triggered when the user moves the mouse wheel up or down on an HTML element. This event fires regardless of whether the element is scrollable or not, making it useful for creating custom interactions based on wheel movement. Syntax Following is the syntax for the onwheel event attribute − Content Where script is the JavaScript code or function to be executed when the wheel event occurs. Parameters The onwheel event automatically passes an event object containing information about the wheel action − event.deltaY ...

Read More

HTML onerror Event Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 354 Views

The HTML onerror event attribute is triggered when an error occurs while loading an external file in an HTML document. This attribute is commonly used with , , , and elements to handle loading failures gracefully. Syntax Following is the syntax for the onerror event attribute − Content Where script is JavaScript code that executes when the loading error occurs. Common Use Cases The onerror attribute is typically used in the following scenarios − Image fallback − Display a placeholder image when the original image fails to load Script ...

Read More

HTML onkeydown Event Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 226 Views

The HTML onkeydown event attribute is triggered when a user presses a key on the keyboard. This event fires at the moment a key is pressed down, before the key is released. It is commonly used for capturing keyboard input, creating keyboard shortcuts, and implementing real-time text processing. The onkeydown event occurs in the following sequence: onkeydown → onkeypress → onkeyup. The onkeydown event fires for all keys including function keys, arrow keys, and special keys like Escape or Tab. Syntax Following is the syntax for the onkeydown event attribute − Content Where ...

Read More

HTML onkeyup Event Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 234 Views

The HTML onkeyup event attribute is triggered when a user releases a key on the keyboard. This event occurs after the onkeydown and onkeypress events, making it useful for capturing the final state of user input after a key has been completely processed. The onkeyup event is commonly used for real-time input validation, live search functionality, character counting, and dynamic content updates as users type. Syntax Following is the syntax for the onkeyup event attribute − Content Where script is the JavaScript code to execute when the key is released. This can be ...

Read More

HTML onkeypress Event Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 279 Views

The HTML onkeypress event attribute is triggered when the user presses a key on the keyboard while focused on an element. This event is commonly used for input validation, real-time text processing, and creating interactive web forms. Syntax Following is the syntax for the onkeypress event attribute − Content Where script is the JavaScript code to execute when a key is pressed. Parameters The onkeypress event attribute accepts the following parameter − script − JavaScript code or function to execute when the keypress event is triggered. Event Object ...

Read More

HTML Navigator appVersion Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 184 Views

The navigator.appVersion property in HTML returns a string containing version information about the browser. This property provides details about the browser's version, platform, and sometimes additional system information. Syntax Following is the syntax for the navigator appVersion property − navigator.appVersion Return Value The navigator.appVersion property returns a string that typically includes − Version number − The browser version information Platform details − Operating system information Engine information − Browser engine details like WebKit or Gecko Note − The format and content of the ...

Read More
Showing 181–190 of 8,010 articles
« Prev 1 17 18 19 20 21 801 Next »
Advertisements