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
HTML Articles
Page 21 of 151
HTML onsearch Event Attribute
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 MoreHTML onselect Event Attribute
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 MoreHTML onwheel Event Attribute
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 MoreHTML onerror Event Attribute
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 MoreHTML onkeydown Event Attribute
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 MoreHTML onkeyup Event Attribute
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 MoreHTML onkeypress Event Attribute
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 MoreHTML Navigator appVersion Property
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 MoreHTML Navigator cookieEnabled Property
The navigator.cookieEnabled property is a read-only property that returns a boolean value indicating whether HTTP cookies are enabled in the user's browser. This property returns true if cookies are enabled and false if they are disabled. This property is useful for web developers to check cookie support before attempting to set or read cookies, ensuring better user experience and preventing errors in cookie-dependent functionality. Syntax Following is the syntax for the navigator cookieEnabled property − navigator.cookieEnabled Return Value The property returns a boolean value − true − If cookies are ...
Read MoreHTML Navigator geolocation Property
The navigator.geolocation property in HTML provides access to the Geolocation API, which allows web applications to retrieve the user's current location. This property returns a Geolocation object that contains methods to get the user's position coordinates, track location changes, and handle location-related errors. The geolocation functionality requires user permission and works best with HTTPS connections. Modern browsers will prompt users to allow or deny location access when a website requests it. Syntax Following is the syntax for accessing the navigator geolocation property − navigator.geolocation The geolocation object provides three main methods − ...
Read More