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 100 of 151
HTML DOM PopStateEvent Object
The HTML DOM PopStateEvent object represents the event that is triggered when the browser's history changes, specifically when the user navigates using the back or forward buttons, or when the history is programmatically modified using history.back(), history.forward(), or history.go(). The popstate event is fired when the active history entry changes between two different history entries for the same document. It provides access to the state data that was stored when the history entry was created using pushState() or replaceState(). Syntax Following is the syntax to handle the popstate event − window.onpopstate = function(event) { ...
Read MoreHTML DOM Pre Object
The HTML DOM Pre Object represents the element in the Document Object Model (DOM). The element is used to display preformatted text, where whitespace and line breaks are preserved exactly as they appear in the HTML source. The Pre Object provides access to all the properties and methods of a standard HTML element, plus specific functionality for handling preformatted text content. Syntax To create a new pre element using JavaScript − document.createElement("PRE"); To access an existing pre element − document.getElementById("preId"); Creating a Pre Object You can ...
Read MoreHTML DOM readyState Property
The DOM readyState property returns the loading status of the current HTML document. This property indicates whether the document is still loading, has finished loading, or has completed loading along with all sub-resources like images and stylesheets. Syntax Following is the syntax for the readyState property − document.readyState Return Value The readyState property returns one of three possible string values − "loading" − The document is still loading content. "interactive" − The document has finished loading and parsing, but sub-resources like images may still be loading. "complete" − The document and ...
Read MoreHTML DOM PageTransition Event
The DOM PageTransitionEvent is fired when a user navigates to or away from a webpage. This event provides information about whether the page was loaded from the browser's cache (back-forward cache) or fetched fresh from the server. The PageTransitionEvent is particularly useful for detecting when pages are restored from the browser's cache, which can affect the state of JavaScript variables and DOM elements. Syntax Following is the syntax for adding PageTransitionEvent listeners − window.addEventListener('pageshow', function(event) { // Handle pageshow event }); window.addEventListener('pagehide', function(event) { // Handle pagehide event ...
Read MoreHTML DOM Input Date stepDown() Method
The HTML DOM Input Date stepDown() method decreases the value of a date input field by a specified number of days. This method is useful for programmatically adjusting dates without requiring manual user input. Syntax Following is the syntax for the stepDown() method − inputDateObject.stepDown(number) Parameters The stepDown() method accepts the following parameter − number − An optional integer specifying how many days to decrease. If omitted, defaults to 1. Return Value The method does not return any value. It directly modifies the value of the ...
Read MoreHTML DOM Input Date stepUp() Method
The HTML DOM Input Date stepUp() method increases the value of a date input field by a specified number of days. This method is useful for programmatically incrementing dates in forms without requiring user interaction with the date picker. Syntax Following is the syntax for the stepUp() method − inputDateObject.stepUp(number) Parameters The stepUp() method accepts the following parameter − number (optional) − A positive integer specifying how many days to increase the date value. If not provided, the default value is 1. Return Value The stepUp() method does ...
Read MoreHTML DOM Input Datetime Object
The HTML DOM Input Datetime Object represents an HTML input element with type="datetime". This input type was designed to allow users to enter both date and time values. However, it's important to note that the datetime input type has been deprecated in HTML5 and is not supported by most modern browsers, which treat it as a regular text input instead. Note: Modern browsers support datetime-local instead of datetime. The datetime type was removed from the HTML specification because it lacked widespread browser support and had usability issues. Syntax Following is the syntax for creating an input element ...
Read MoreHTML DOM Input Datetime type Property
The HTML DOM Input Datetime type property allows you to get or set the type attribute of an input element that was initially created as a datetime input. This property is useful for dynamically changing input types or checking the current type of an input element. Note: The datetime input type has been deprecated in HTML5. Most modern browsers treat it as a text input. For date and time inputs, use datetime-local, date, or time instead. Syntax Following is the syntax for returning the type value − inputDatetimeObject.type Following is the syntax for ...
Read MoreHTML DOM Input DatetimeLocal max Property
The HTML DOM Input DatetimeLocal max property returns or sets the maximum allowed date and time value for a datetime-local input field. This property corresponds to the max attribute in HTML and helps restrict user input to a specific upper limit. Syntax Following is the syntax for returning the max value − inputDatetimeLocalObject.max Following is the syntax for setting the max value − inputDatetimeLocalObject.max = "YYYY-MM-DDThh:mm:ss" Return Value The max property returns a string representing the maximum date and time value in the format YYYY-MM-DDThh:mm:ss. If no max attribute ...
Read MoreHTML DOM Input DatetimeLocal Object
The HTML DOM Input DatetimeLocal Object represents an HTML input element with type="datetime-local". This input type allows users to select both a date and time without timezone information, providing a convenient interface for date-time selection in web forms. The datetime-local input displays a date picker combined with a time picker, making it easier for users to enter precise date and time values. The selected value is stored in the format YYYY-MM-DDTHH:MM. Syntax Following is the syntax for creating an input element with type datetime-local − To create a datetime-local input programmatically using ...
Read More