Articles on Trending Technologies

Technical articles with clear explanations and examples

Execute a script when the user opens or closes the element in HTML?

Abhinaya
Abhinaya
Updated on 16-Mar-2026 209 Views

The ontoggle event in HTML is triggered when a user opens or closes the element. This event allows you to execute JavaScript functions whenever the disclosure state of a details element changes, making it useful for tracking user interactions or updating content dynamically. Syntax Following is the syntax for the ontoggle event attribute − Summary text Content to be shown/hidden The ontoggle event fires both when the details element is opened (expanded) and when it is closed (collapsed). Basic Example Following example demonstrates ...

Read More

HTML DOM Input Date value Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 178 Views

The HTML DOM Input Date value property allows you to get or set the value of an element. The value is returned as a string in YYYY-MM-DD format, which is the ISO 8601 date format standard. Syntax Following is the syntax to get the value − inputDateObject.value Following is the syntax to set the value − inputDateObject.value = 'YYYY-MM-DD' Return Value The value property returns a string representing the selected date in YYYY-MM-DD format. If no date is selected, it returns an empty string. Getting the Date ...

Read More

How to merge table columns in HTML?

Anjana
Anjana
Updated on 16-Mar-2026 68K+ Views

To merge table columns in HTML, use the colspan attribute in the or tag. This attribute allows a cell to span across multiple columns, effectively merging them together. The value of colspan specifies how many columns the cell should span. Syntax Following is the syntax for merging table columns using the colspan attribute − Content Content Where number represents the number of columns the cell should span across. Basic Table Structure Let us first create a basic 3x3 table to understand the structure before applying column merging − ...

Read More

HTML DOM Input Datetime autofocus Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 194 Views

The HTML DOM Input Datetime autofocus property sets or returns whether a datetime input field should automatically receive focus when the page loads. This property corresponds to the autofocus attribute in HTML. Syntax Following is the syntax for getting the autofocus property value − inputDatetimeObject.autofocus Following is the syntax for setting the autofocus property − inputDatetimeObject.autofocus = booleanValue Return Value The property returns a boolean value indicating whether the datetime input has autofocus enabled − Value Description true The input field ...

Read More

HTML DOM Input Datetime disabled Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 218 Views

The HTML DOM Input Datetime disabled property sets or returns whether an Input Datetime field is enabled or disabled. When set to true, the input field becomes non-interactive and appears grayed out, preventing user input. Syntax Following is the syntax for returning the disabled status − inputDatetimeObject.disabled Following is the syntax for setting the disabled property − inputDatetimeObject.disabled = booleanValue Parameters The booleanValue parameter accepts the following values − Value Description true Disables the input datetime field, making it non-interactive and ...

Read More

Execute a script when a Web Storage area is updated in HTML?

Ankitha Reddy
Ankitha Reddy
Updated on 16-Mar-2026 192 Views

The onstorage attribute in HTML is used to execute a script when the Web Storage area (localStorage or sessionStorage) is updated. This event is triggered when storage data changes in another window or tab of the same origin, making it useful for synchronizing data across multiple browser windows. Syntax Following is the syntax for the onstorage attribute − The onstorage event is typically attached to the element and fires when: Another window or tab modifies localStorage Another window or tab modifies sessionStorage Storage items are added, modified, or removed from ...

Read More

HTML DOM Input Datetime form Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 178 Views

The HTML DOM Input Datetime form property returns a reference to the form element that contains the input datetime field. This property is read-only and provides access to the parent form object, allowing you to interact with form properties and methods programmatically. Syntax Following is the syntax for accessing the form property − inputDatetimeObject.form Return Value The property returns a reference to the HTMLFormElement that contains the input datetime element. If the input is not inside a form, it returns null. Example − Getting Form Reference Following example demonstrates how to ...

Read More

What is difference between vs. ?

Swarali Sree
Swarali Sree
Updated on 16-Mar-2026 2K+ Views

In HTML, the element and serve similar purposes but have important differences. The element can contain rich content like text, images, and other HTML elements, while can only display plain text through its value attribute. Syntax Following is the syntax for the element − Content Following is the syntax for − HTML Element The element is used for creating interactive buttons within HTML forms or anywhere on a web page. It can contain rich content including text, images, icons, and ...

Read More

HTML DOM Input Datetime max Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 210 Views

The HTML DOM Input Datetime max property returns or sets the value of the max attribute of an HTML datetime input element. This property defines the maximum date and time value that a user can enter in the datetime field. Syntax Following is the syntax for returning the max property − inputDatetimeObject.max Following is the syntax for setting the max property − inputDatetimeObject.max = "YYYY-MM-DDThh:mm:ssTZD" Property Value The max property accepts a string value representing a date and time in ISO 8601 format. The format YYYY-MM-DDThh:mm:ssTZD consists of the ...

Read More

HTML DOM Input Datetime min Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 196 Views

The HTML DOM Input Datetime min property sets or returns the minimum value allowed for a datetime input field. This property corresponds to the min attribute in HTML and helps restrict users from selecting dates and times earlier than the specified minimum value. Syntax Following is the syntax to return the min property value − inputDatetimeObject.min Following is the syntax to set the min property value − inputDatetimeObject.min = "YYYY-MM-DDThh:mm:ssTZD" Property Value The min property accepts a string value in the format YYYY-MM-DDThh:mm:ssTZD representing a valid datetime. Following table ...

Read More
Showing 13941–13950 of 61,297 articles
Advertisements