HTML | DOM Input Password Object Last Updated : 25 Aug, 2022 Comments Improve Suggest changes Like Article Like Report The Input Password Object in HTML DOM is used to represent an HTML input element with type="password". The input element with type="password" can be accessed by using getElementById() method. Syntax: It is used to access input type="password"document.getElementById("id");It is used to create type="password" element.document.createElement("input"); Object Properties: PropertyDescriptiontypeThis property is used to return which type of form element the password field is.valueThis property is used to set or return the value of the value attribute of a password field.autocompleteThis property is used to set or return the value of the autocomplete attribute of a password field.autofocusThis property is used to set or return whether a password field should automatically get focus when the page loads.defaultValueThis property is used to set or return the default value of a password field.disabledThis property is used to set or return whether a password field is disabled or not.formThis property is used to return reference to the form that contains the password field.maxLengthThis property is used to set or return the value of the maxlength attribute of a password field.nameThis property is used to set or return the value of the name attribute of a password field.placeholderThis property is used to set or return the value of the placeholder attribute of a password field.readOnlyThis property is used to set or return whether the password field is read-only or not.requiredThis property is used to set or return whether the password field must be filled out before submitting a form.sizeThis property is used to set or return the value of the value attribute of the password field. Input Password Object Methods: select(): This is used to select the content of a password field. Example-1: HTML <!DOCTYPE html> <html> <body style="text-align:center;"> <h1 style="color:green;"> GeeksForGeeks </h1> <h2>DOM Input Password Object</h2> Password: <input type="password" id="myPsw" value="geeks12"> <p>Click the button to get the password of the password field.</p> <button onclick="myFunction()"> Click Here! </button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById( "myPsw").value; document.getElementById( "demo").innerHTML = x; } </script> </body> </html> Output: Before click on the button: After click on the button: Example-2: HTML <!DOCTYPE html> <html> <body style="text-align:center;"> <h1 style="color:green;"> GeeksForGeeks </h1> <h2>DOM Input Password Object</h2> <p>Click the button to create a Password Field.</p> <button onclick="myFunction()"> Click Here! </button> <script> function myFunction() { // Creating input element. var x = document.createElement("INPUT"); // Set type password. x.setAttribute("type", "password"); x.setAttribute("value", "geeks12"); document.body.appendChild(x); } </script> </body> </html> Output: Before click on the button: After click on the button: Supported Browsers: Google Chrome 1+Mozilla Firefox 1+Edge 12+Safari 1+Opera 2+ Comment More infoAdvertise with us D divyatagoel0709 Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML | DOM Style animationPlayState Property The HTML DOM Style animationPlayState Property is used to specify whether an animation is running or paused. Syntax : animation-play-state: running|paused|initial|inherit; Return Values: It returns a string that represents the animation-play-state property of an element Property Values: running: Thi 3 min read HTML | DOM Map Object The Map Object in HTML DOM is used to create and access the <map> element. The Map Object create the portion of image clickable and accessible.Syntax: It is used to return Map object.var x = document.getElementById("myMap");It is used to create Map Object.var x = document.createElement("MAP"); 2 min read HTML | DOM Style backgroundImage Property The DOM Style backgroundImage Property is used to set or return the background image of an element. Syntax: To get the backgroundImage propertyobject.style.backgroundImageTo set the backgroundImage propertyobject.style.backgroundImage = "image | none | initial | inherit" Return Values: It returns a 3 min read HTML | DOM TableRow Object The TableRow Object in HTML DOM is used to represent the HTML <tr> element. The <tr> element can be accessed by using getElementById() method. Syntax: document.getElementById("id"); The tr element can be created by using the document.createElement() method. Syntax: document.createElement 3 min read HTML DOM Style order Property The HTML DOM Style order property specifies the order of a flexible element relative to the rest of the flexible elements inside the same container element. SyntaxSet the order property.object.style.order = "number | initial | inherit"Return the order property.object.style.orderReturn ValuesIt retu 1 min read HTML | DOM Embed Object The Embed Object in HTML DOM is used to represent the <embed> element. The <embed> element can be accessed by using getElementById() method. Note: This object is new in HTML 5. Property Values: height: It sets or returns the value of the height attribute. src: It sets or returns the valu 2 min read HTML DOM Anchor Object The Anchor Object in HTML DOM is used to represent the <a> element. The anchor element can be accessed by using getElementById() method. Syntax: document.getElementById("ID"); Where ID is assigned to the anchor tag. Property Values: Property Description charset Set or return the character set. 2 min read HTML DOM ColumnGroup Object The ColumnGroup Object in HTML DOM is used to represent the HTML <colgroup> element. This tag is used to set or return the properties of <colgroup> element. It can be accessed by using getElementById() method. Syntax: document.getElementById( "ColGroup_ID" );This ColGroup_ID is assigned 2 min read HTML | DOM Window frameElement Properties HTML DOM Window frameElement property returns the iframe element in which the window is embedded or stored. If it is not stored, in that case, it simply returns a null value. Syntax: window.frameElement Return Value: It returns an IFrame object or null. Example: html <!DOCTYPE html> <html 1 min read HTML | DOM Style columnRuleStyle Property The DOM style columnRuleStyle Property in HTML is used to define or determine the style of rule between columns. Syntax : To set the property: object.style.columnRuleStyle = "none|hidden|dotted|dashed|solid| double|groove|ridge|inset|outset|initial|inherit" To return the property: object.style.colum 6 min read Like