Found 2416 Articles for HTML

HTML DOM execCommand() method

AmitDiwan
Updated on 19-Feb-2021 08:07:46

733 Views

The HTML DOM execCommand() method is used for executing a command specified on the editable section that is being selected by the user. The document.design property should be set to have an editable section in the first place.SyntaxFollowing is the syntax for the execCommand() method −document.execCommand(command, showUI, value)Here, value is for some specific commands that needs to be completed, such as, fontSize, forecolor, etc. The showUI is a boolean value for specifying if the value should be shown or not. The command name is the command that needs to be executed on the editable section.Following are the values for the ... Read More

HTML DOM emphasized object

AmitDiwan
Updated on 19-Feb-2021 08:09:10

66 Views

The HTML DOM emphasized object is associated with the HTML element. The element is used for emphasizing some text and it marks that text in italic. You can create and access emphasized object using createElement() or getElementById() method respectively.SyntaxFollowing is the syntax for −Creating an emphasized object −var e = document.createElement("EM");ExampleLet us look at an example for the emphasized object −Live Demo emphasized object example Create an em element by clicking the button below CREATE    function createEM() {       var e = document.createElement("EM");       var txt = document.createTextNode("HELLO WORLD"); ... Read More

HTML DOM Input Password name Property

AmitDiwan
Updated on 19-Feb-2021 08:10:20

83 Views

The HTML DOM Input Password name property is used for setting or returning the name attribute of an input password field. The name attribute helps in identifying the form data after it has been submitted to the server. JavaScript can also use the name attribute to refer form elements to manipulate later on.SyntaxFollowing is the syntax for −Setting the name property −passwordObject.name = nameHere, name is for specifying the password field name.ExampleLet us look at an example for the password name property −Live Demo Input Password name Property Password: Change the name of the password field by ... Read More

HTML DOM Input Password maxLength Property

AmitDiwan
Updated on 19-Feb-2021 08:11:34

315 Views

The HTML DOM Input Password maxlength property is used for setting or returning the maxlength attribute of the input password field. The maxLength property specifies the maximum number of characters you can type in a password field.SyntaxFollowing is the syntax for −Setting the maxLength property −passwordObject.maxLength = integerHere, integer specifies the maximum number of characters that can be typed in the password field.ExampleLet us look at an example for the maxLength form property −Live Demo Input Password maxLength Property Password: Increase the maximum number of characters to be entered for the above field by clicking below button ... Read More

HTML DOM Input Password form Property

AmitDiwan
Updated on 19-Feb-2021 09:01:52

122 Views

The HTML DOM Input Password form property is used for returning the form reference that contains the input password field. If the input password field is outside the form then it will simply return NULL. This property is read-only.SyntaxFollowing is the syntax for input password form property.passwordObject.formExampleLet us look at an example for the Input Password form property −Live Demo Input Password form Property Password: Get the form id by clicking on the below button GET FORM    function formId() {       var P=document.getElementById("PASS").form.id;       document.getElementById("Sample").innerHTML = "The id ... Read More

HTML DOM Input Password disabled Property

AmitDiwan
Updated on 19-Feb-2021 09:05:34

109 Views

The HTML DOM Input Password disabled property is used for setting or returning whether the password field is disabled or not. It uses boolean values with true representing the element should be disabled and false otherwise. The disabled property is set to false by default. The disabled element is greyed out by default and is unclickable.SyntaxFollowing is the syntax for −Setting the disabled property −passwordObject.disabled = true|false;Here, true=password field is disabled and false=the password field is not disabled. It is false by default.ExampleLet us look at an example for the Input password disabled property −Live Demo Input Password ... Read More

HTML DOM Input Password defaultValue Property

AmitDiwan
Updated on 19-Feb-2021 09:07:25

199 Views

The HTML DOM Input Password defaultValue property is used for setting or getting the defaultValue of a password field. The defaultValue of an element is the value assigned to the value attribute. The difference between value property and defaultValue property is that the defaultValue property retains the original default value specified while the value property change based on the user input in the input field.SyntaxFollowing is the syntax to set the defaultValue property −passwordObject.defaultValue = valueHere, “value” is the password field default value.ExampleLet us look at an example for the Input Password defaultValue property −Live Demo Input Password ... Read More

HTML DOM Input Password autofocus Property

AmitDiwan
Updated on 09-Aug-2019 10:40:30

231 Views

The HTML DOM input Password autofocus property is associated with the HTML element’s autofocus attribute. This property is used for setting or returning if the input password field should be automatically focused when the page loads or not.SyntaxFollowing is the syntax to −Set the autofocus property −passwordObject.autofocus = true|falseHere, true represents that the password field should get focus and false represents otherwise. It is set to false by default.ExampleLet us look at an example for the Input Password autofocus property − Input password autofocus property Password: CHECK FOCUS    function FocusVal() {   ... Read More

HTML DOM Input Number value Property

AmitDiwan
Updated on 19-Feb-2021 09:10:08

309 Views

The HTML DOM Input number value property is associated with the input element having type=”Number” and having the value attribute. This property is used for returning the value of input element value attribute or to set it. This property is used for specifying a default value for elements and it also changes its value to user input.SyntaxFollowing is the syntax for −Setting the value property −numberObject.value = number;Here, number is used for specifying the value for the number field.ExampleLet us look at an example for the input Number value property −Live Demo Input Number Value property PHONE NO: ... Read More

HTML DOM Input Number type Property

AmitDiwan
Updated on 19-Feb-2021 09:11:44

149 Views

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

Advertisements