Found 2416 Articles for HTML

HTML DOM Input Range autofocus property

AmitDiwan
Updated on 22-Aug-2019 11:54:00

81 Views

The HTML DOM input range autofocus property is associated with the HTML element’s autofocus attribute. This property is used for setting or returning if the input range slider should be automatically focused when the page loads or not.SyntaxFollowing is the syntax for −Setting the autofocus property −rangeObject.autofocus = true|falseHere, true represents the range slider should get focus and the false represents otherwise. It is set to false by default.ExampleLet us look at an example for the Input range autofocus property − Live Demo Input range autofocus property CHECK    function rangeFocus() { ... Read More

HTML DOM Input Radio value Property

AmitDiwan
Updated on 22-Aug-2019 11:48:05

113 Views

The HTML DOM Input radio value property is associated with the input element having type=”radio” and the value attribute. It is used to return the value of radio button value attribute or to set it.The value property for radio button doesn’t affect the user interface of the website as the content is simply not displayed. However it can be used to distinguish between several buttons of the same group when the form is submitted.SyntaxFollowing is the syntax for −Set the value property −radioObject.value = text;Here, text is used for specifying the value for the radio button.ExampleLet us look at an ... Read More

HTML DOM Input Radio type property

AmitDiwan
Updated on 22-Aug-2019 11:43:33

106 Views

The HTML DOM Input radio type property is associated with the input element having its type=”radio”. It will always return radio for the input radio element.SyntaxFollowing is the syntax for radio type property −radioObject.typeExampleLet us look at an example for the radio type property − Live Demo Input radio type Property FRUIT: Mango Get the above input element type by clicking the below button GET Type    function radioType() {       var P=document.getElementById("Mango").type;       document.getElementById("Sample").innerHTML = "The type for the input field is: "+P ;    } OutputThis ... Read More

HTML DOM Input Password type property

AmitDiwan
Updated on 22-Aug-2019 10:39:46

78 Views

The HTML DOM Input password type property is associated with the input element having its type=”password”. It will always return password for the input password element.SyntaxFollowing is the syntax for password type property −passwordObject.typeExampleLet us look at an example for the Input password type property − Live Demo password type property PASSWORD: Get the above element type by clicking the below button Get Type    function getType() {       var t = document.getElementById("PASS1").type;       document.getElementById("Sample").innerHTML = "The type for the input field is : "+t;    } OutputThis will produce ... Read More

HTML DOM Input Password size property

AmitDiwan
Updated on 22-Aug-2019 09:12:03

96 Views

The HTML DOM Input Password size property is used for setting or returning the input password size attribute value. It is used for defining the password field width in terms of characters. The default width is of 20 characters.SyntaxFollowing is the syntax for −Setting the password size property −passwordObject.size = numberHere, number represents the password field width in characters. The default width is 20 characters.ExampleLet us look at an example for the Input password size property − Input password size property Password: Change the Password field width by clicking the below button CHANGE    function ... Read More

HTML DOM Input Password required property

AmitDiwan
Updated on 22-Aug-2019 09:04:18

102 Views

The HTML DOM input password required property is associated with the required attribute of an element. The required property is used for setting and returning if it is necessary to fill some password field or not before the form is submitted to the server. This allows the form to not submit if a password field with required attribute is left empty by the user.SyntaxFollowing is the syntax for −Setting the required property −textObject.required = true|falseHere, true represents the text field must be filled while false represents its optional to fill the field before submitting the form.ExampleLet us look at ... Read More

HTML DOM Input Password readOnly property

AmitDiwan
Updated on 22-Aug-2019 08:52:39

105 Views

The HTML DOM Input Password readOnly property is used for setting or returning whether the input password field is read-only or not. The readOnly property makes the element non-editable but it can still be focused by tab or by clicking. If there is a default value inside a read-only element then it is sent to server on submit.SyntaxFollowing is the syntax for −Set the readOnly property −passwordObject.readOnly = true|falseHere, true represents the password field is read only while false represents otherwise. The readOnly property is set to false by default.ExampleLet us look at an example for the password readOnly property ... Read More

HTML DOM Input Password placeholder property

AmitDiwan
Updated on 22-Aug-2019 08:37:42

291 Views

The HTML DOM Input Password placeholder property is used for setting or returning the placeholder attribute value of an input password field. The placeholder property is used for giving the web page users a hint about the input element by showing a text inside the input field befor the user inputs anything. The placeholder text is greyed by default and isn’t submitted to the form unlike the value property.SyntaxFollowing is the syntax for −Setting the placeholder property −passwordObject.placeholder = textHere, text represents the placeholder text specifying the hint for the user about the password field.ExampleLet us look at an example ... Read More

HTML DOM Input Password pattern property

AmitDiwan
Updated on 22-Aug-2019 08:28:31

325 Views

The HTML DOM Input Password pattern property is used for setting or returning the pattern attribute of an input password field. It checks the password against a regular expression specified by the pattern property.SyntaxFollowing is the syntax forSetting the pattern property −passwordObject.pattern = regexpHere, regexp is a regular expression against which the password field is checked.ExampleLet us look at an example for the password pattern property − Input Password pattern property The password can either be of three numeric characters or 6 alphabet characters from a to g Password: GET PATTERN   ... Read More

HTML DOM Input Password object

AmitDiwan
Updated on 22-Aug-2019 08:17:52

188 Views

The HTML DOM Input Password object is associated with the element with type “password”. We can create and access an input element with type password using the createElement() and getElementById() methods respectively.PropertiesFollowing are the properties for the password object −Sr.NoProperty & Description1autocompleteTo set or return the autocomplete attribute value of a password field2autofocusTo set or return if the password field should automatically get focus when the page loads.3defaultValueTo set or return the password field default value.4disabledTo set or return whether the password field is disabled, or not.5formTo return the reference of the form containing the password field6maxLengthTo set or ... Read More

Advertisements