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
Web Development Articles
Page 14 of 801
HTML DOM Storage setItem() method
The HTML DOM Storage setItem() method is used to create or update a key-value pair in web storage. This method stores data in either localStorage (persistent across browser sessions) or sessionStorage (temporary for the current session) by specifying a key name and its corresponding value. Syntax Following is the syntax for the Storage setItem() method − localStorage.setItem(keyname, value); OR sessionStorage.setItem(keyname, value); Parameters The setItem() method accepts two parameters − keyname − A string representing the key name under which the data will be stored. ...
Read MoreHTML DOM del dateTime Property
The HTML DOM del dateTime property is associated with the HTML element and specifies when text content was deleted from the document. This property corresponds to the datetime attribute and provides a machine-readable timestamp indicating the date and time of deletion. Syntax Following is the syntax for setting the dateTime property − delObject.dateTime = "YYYY-MM-DDThh:mm:ssTZD" Following is the syntax for getting the dateTime property − var dateTimeValue = delObject.dateTime Parameters The dateTime property accepts a string value in the following format − YYYY − Four-digit year ...
Read MoreHTML DOM Input Radio autofocus property
The HTML DOM Input Radio autofocus property is associated with the HTML element's autofocus attribute. This property sets or returns whether a radio button should automatically receive focus when the page loads. Syntax Following is the syntax for setting the autofocus property − radioObject.autofocus = true|false Following is the syntax for getting the autofocus property − var focusState = radioObject.autofocus; Parameters The autofocus property accepts boolean values − true − The radio button will automatically get focus when the page loads. false − The radio button ...
Read MoreHTML DOM Input Radio defaultChecked Property
The HTML DOM Input Radio defaultChecked property determines whether a radio button was checked by default when the page first loaded. It returns true if the radio button has the checked attribute in the HTML markup, otherwise it returns false. This property reflects the initial state, not the current checked state. Syntax Following is the syntax for the Radio defaultChecked property − radioObject.defaultChecked Return Value The defaultChecked property returns a Boolean value − true − If the radio button has the checked attribute in HTML false − If the radio button ...
Read MoreHTML DOM Input Radio name Property
The HTML DOM Input Radio name property is used for setting or returning the name attribute of a radio button input field. The name attribute is crucial for identifying form data after submission to the server and for grouping radio buttons together so only one can be selected at a time. Syntax Following is the syntax for setting the name property − radioObject.name = "name" Following is the syntax for getting the name property − var name = radioObject.name Parameters The name parameter is a string that specifies the ...
Read MoreHTML DOM Input Radio object
The HTML DOM Input Radio object represents an element with type="radio". Radio buttons allow users to select one option from a group of related choices. The Input Radio object provides properties and methods to dynamically create, access, and manipulate radio button elements using JavaScript. Syntax Following is the syntax for creating an input radio object − var radioElement = document.createElement("INPUT"); radioElement.setAttribute("type", "radio"); Following is the syntax for accessing an existing input radio object − var radioElement = document.getElementById("radioId"); Properties Following are the key properties of the Input Radio ...
Read MoreHTML DOM Input Radio required property
The HTML DOM Input Radio required property is associated with the required attribute of an element. The required property is used for setting and returning whether it is necessary to check a radio button before the form is submitted to the server. This allows the form to not submit if a radio button with the required attribute is left unchecked by the user. Syntax Following is the syntax for setting the required property − radioObject.required = true|false Following is the syntax for getting the required property − var isRequired = radioObject.required; ...
Read MoreHTML DOM Input Password pattern property
The HTML DOM Input Password pattern property is used for setting or returning the pattern attribute of an input password field. It validates the password against a regular expression specified by the pattern property to ensure the input meets specific format requirements. Syntax Following is the syntax for setting the pattern property − passwordObject.pattern = regexp Following is the syntax for returning the pattern property − passwordObject.pattern Parameters regexp − A string containing a regular expression that the password input value must match. If the input doesn't match the ...
Read MoreHTML DOM Input Password placeholder property
The HTML DOM Input Password placeholder property is used for setting or returning the placeholder attribute value of a password input field. The placeholder provides a hint to users about what kind of input is expected, displaying greyed-out text inside the field before any user input. Unlike the value property, placeholder text is not submitted with the form data. Syntax Following is the syntax for setting the placeholder property − passwordObject.placeholder = text Following is the syntax for getting the placeholder property − var placeholderText = passwordObject.placeholder Parameters text ...
Read MoreHTML DOM Input Password required property
The HTML DOM Input Password required property is associated with the required attribute of an element with type="password". This property sets or returns whether a password field must be filled before form submission. When set to true, the browser prevents form submission if the password field is empty and displays a validation message. Syntax Following is the syntax for setting the required property − passwordObject.required = true|false Following is the syntax for getting the required property − var isRequired = passwordObject.required; Parameters The required property accepts the following ...
Read More