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 22 of 151
HTML Navigator onLine Property
The HTML navigator.onLine property returns a boolean value that indicates whether the browser is currently online or offline. This property is part of the Navigator interface and provides a simple way to check the network connectivity status of the user's browser. Syntax Following is the syntax for the navigator onLine property − navigator.onLine Return Value The navigator.onLine property returns − true − If the browser is online (connected to the internet) false − If the browser is offline (not connected to the internet) Basic Usage Example Following example ...
Read MoreHTML Navigator userAgent Property
The navigator.userAgent property in HTML returns a string containing the complete user-agent header that the browser sends to web servers. This string contains information about the browser name, version, operating system, and rendering engine, making it useful for browser detection and compatibility checks. Syntax Following is the syntax for the navigator userAgent property − navigator.userAgent Return Value The property returns a string representing the user-agent header. This string typically includes the browser name, version, operating system, and other identifying information that the browser reports to web servers. Example − Basic userAgent Display ...
Read MoreHTML Navigator javaEnabled() Method
The navigator.javaEnabled() method in JavaScript returns a boolean value indicating whether Java is enabled in the current browser. This method is part of the Navigator interface and provides information about the browser's Java support capabilities. Syntax Following is the syntax for the navigator.javaEnabled() method − navigator.javaEnabled() Parameters This method does not accept any parameters. Return Value The method returns a boolean value − true − If Java is enabled in the browser false − If Java is disabled or not available in the browser Example − Basic ...
Read MoreHTML Location assign( ) Method
The HTML Location assign() method loads a new document at the specified URL. Unlike setting window.location.href directly, this method explicitly adds an entry to the browser's history, allowing users to navigate back to the previous page using the back button. Syntax Following is the syntax for the Location assign() method − location.assign(URL) Parameters The method accepts the following parameter − URL − A string representing the absolute or relative URL of the page to navigate to. Return Value This method does not return any value. It performs navigation ...
Read MoreHTML onafterprint Event Attribute
The HTML onafterprint event attribute is triggered when a page has started printing or if the print dialog box has been closed in the HTML document. This event is useful for restoring page styles or displaying messages after the print operation is completed. Syntax Following is the syntax for the onafterprint event attribute − The script parameter contains JavaScript code or a function call that executes after printing occurs. Parameters The onafterprint event attribute accepts the following parameter − script − A JavaScript function or code that runs when ...
Read MoreHTML ononline Event Attribute
The HTML ononline event attribute is triggered when the browser detects that the device has regained an internet connection. This event is useful for applications that need to respond when network connectivity is restored, such as syncing data or updating the user interface. Syntax Following is the syntax for the ononline event attribute − Content The script parameter can be a JavaScript function call or inline JavaScript code that executes when the online event is triggered. How It Works The ononline event is fired on the element when the browser's navigator.onLine ...
Read MoreHTML onpageshow Event Attribute
The HTML onpageshow event attribute is triggered when a user navigates to a webpage. This event fires every time the page is loaded, including when the page is loaded from the browser's cache (back/forward navigation). It is particularly useful for detecting when a page becomes visible to the user. Syntax Following is the syntax for the onpageshow event attribute − The script parameter contains JavaScript code or a function call that executes when the page is shown to the user. Key Features The onpageshow event has several important characteristics − ...
Read MoreHTML ondrop Event Attribute
The HTML ondrop event attribute is triggered when a draggable element or text is dropped on a valid drop target in an HTML document. This event is part of the HTML5 drag and drop API, which enables interactive user interfaces where elements can be moved between different areas of a webpage. Syntax Following is the syntax for the ondrop event attribute − Where script is the JavaScript code to execute when the drop event occurs. Parameters The ondrop event handler receives an event object with the following key properties − ...
Read MoreHTML onmouseup Event Attribute
The HTML onmouseup event attribute is triggered when a mouse button is released from an HTML element. This event occurs after the mouse button has been pressed down and then released, making it useful for implementing interactive click behaviors and drag-and-drop functionality. Syntax Following is the syntax for the onmouseup event attribute − Content Where script is the JavaScript code to execute when the mouse button is released over the element. How onmouseup Works The onmouseup event is part of the mouse event sequence. When you interact with an element using a ...
Read MoreHTML onmousedown Event Attribute
The HTML onmousedown event attribute is triggered when a mouse button is pressed down on an HTML element. This event fires immediately when the user presses any mouse button (left, right, or middle) while the cursor is over the element, before the button is released. Syntax Following is the syntax for the onmousedown event attribute − Where script is the JavaScript code to execute when the mouse button is pressed down on the element. Parameters The onmousedown event attribute accepts the following parameter − script − JavaScript code or ...
Read More