Javascript examples for DOM HTML Element:Input Password
The Input object represents an HTML <input> element with type="password".
You can access an <input> element with type="password" by using getElementById():
<!DOCTYPE html> <html> <body> Password: <input type="password" id="myPsw" value="psw123"> <button onclick="myFunction()">get the password of the password field</button> <p id="demo"></p> <script> function myFunction() {/*from w ww.ja v a 2 s .c om*/ var x = document.getElementById("myPsw").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>