Articles on Trending Technologies

Technical articles with clear explanations and examples

HTML DOM Input DatetimeLocal step Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 403 Views

The HTML DOM Input DatetimeLocal step property sets or returns the value of the step attribute of a datetime-local input field. This property determines the legal number intervals for the seconds (or milliseconds) component of the datetime-local input. Syntax Following is the syntax for returning the step value − inputDatetimeLocalObject.step Following is the syntax for setting the step value − inputDatetimeLocalObject.step = number Parameters The number parameter can have the following values − Value Description seconds Valid values are numbers that ...

Read More

HTML DOM Input Checkbox defaultChecked Property

karthikeya Boyini
karthikeya Boyini
Updated on 16-Mar-2026 467 Views

The HTML DOM input checkbox defaultChecked property returns the default value of the checked attribute of a checkbox element. This property reflects whether the checkbox was initially checked when the page loaded, regardless of its current state. Syntax Following is the syntax for getting the defaultChecked property − checkboxObject.defaultChecked This property returns a boolean value − true − if the checkbox was initially checked (had the checked attribute) false − if the checkbox was initially unchecked Understanding defaultChecked vs checked The defaultChecked property differs from the checked property − ...

Read More

HTML DOM Input DatetimeLocal stepDown( ) Method

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 120 Views

The HTML DOM Input DatetimeLocal stepDown() method decreases the value of a datetime-local input field by a specified number of minutes. This method is useful for programmatically adjusting datetime values in incremental steps. Syntax Following is the syntax for the stepDown() method − inputDatetimeLocalObject.stepDown(number) Parameters The stepDown() method accepts one optional parameter − number − An integer that specifies how many minutes to decrease the value by. If omitted, the default value is 1. Return Value This method does not return any value. It directly modifies the value ...

Read More

How to use telephone input type in HTML?

Monica Mona
Monica Mona
Updated on 16-Mar-2026 658 Views

The telephone input type in HTML uses the element to create form fields specifically designed for telephone numbers. This input type provides better user experience on mobile devices by displaying a numeric keypad and enables semantic validation. Syntax Following is the syntax for the telephone input type − The tel input type accepts any text but is optimized for telephone number entry, especially on mobile browsers. Basic Example Following example demonstrates a simple telephone input field − HTML Telephone Input ...

Read More

Execute a script when a user navigates away from a page in HTML?

Nishtha Thakur
Nishtha Thakur
Updated on 16-Mar-2026 318 Views

When a user navigates away from a page, you can execute JavaScript code using the onpagehide event attribute. This event triggers when the user leaves the page by clicking a link, closing the browser tab, submitting a form, refreshing the page, or navigating to another URL. The onpagehide event is part of the HTML5 Page Visibility API and provides a reliable way to detect when users are leaving your page, making it useful for cleanup tasks, saving user data, or logging analytics. Syntax Following are the different ways to use the onpagehide event − HTML attribute ...

Read More

HTML DOM Input Checkbox autofocus Property

karthikeya Boyini
karthikeya Boyini
Updated on 16-Mar-2026 242 Views

The HTML DOM Input Checkbox autofocus Property sets or returns whether a checkbox should automatically receive focus when the page loads. This property corresponds to the autofocus attribute in HTML and is useful for improving user experience by directing attention to important form elements. When a checkbox has the autofocus property set to true, it will be highlighted with a focus outline as soon as the page finishes loading, without requiring user interaction. Syntax Following is the syntax for returning the autofocus property − checkboxObject.autofocus Following is the syntax for setting the autofocus ...

Read More

HTML DOM Input DatetimeLocal stepUp( ) Method

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 135 Views

The HTML DOM Input DatetimeLocal stepUp() method increases the value of a datetime-local input field by a specified number of minutes. This method provides a programmatic way to increment the datetime value without user interaction. Syntax Following is the syntax for the stepUp() method − inputDatetimeLocalObject.stepUp(number) Parameters The stepUp() method accepts the following parameter − number − A numeric value representing the number of steps to increase. This parameter is optional and defaults to 1 if not specified. Each step represents one minute for datetime-local inputs. Return Value ...

Read More

Execute a script when the browser window is closed in HTML?

Prabhas
Prabhas
Updated on 16-Mar-2026 793 Views

The onunload event attribute in HTML triggers when the browser window is being closed, refreshed, or navigated away from. This event allows you to execute JavaScript code before the page is completely unloaded from memory. Syntax Following is the syntax for the onunload attribute − You can also use addEventListener in JavaScript − window.addEventListener('unload', function() { // Your code here }); Using onunload Attribute The onunload event fires when the user leaves the page by closing the browser window, clicking a link, refreshing the ...

Read More

HTML DOM History length Property

Sharon Christine
Sharon Christine
Updated on 16-Mar-2026 182 Views

The HTML DOM History length property returns the number of URLs in the browser's session history list for the current window. This includes all pages visited during the current browsing session, including the current page. Syntax Following is the syntax for the History length property − history.length Return Value The history.length property returns an integer representing the total number of entries in the session history stack. This count includes − The current page All previously visited pages in the current tab/window session Pages navigated to using browser back/forward buttons ...

Read More

How to use week input type in HTML?

Sai Subramanyam
Sai Subramanyam
Updated on 16-Mar-2026 546 Views

The week input type in HTML allows users to select a specific week and year using the element. This input type displays a date picker interface where users can choose a week from a calendar, making it useful for applications that need week-based scheduling, reporting, or data entry. When a user interacts with a week input field, most browsers display a date picker popup that shows weeks in a calendar format, allowing easy selection of the desired week and year. Syntax Following is the syntax for the week input type − ...

Read More
Showing 13481–13490 of 61,297 articles
Advertisements