Javascript examples for DOM HTML Element:Input Password
Input Password defaultValue Property - Return the default value of a password field:
<!DOCTYPE html> <html> <body> Password: <input type="password" id="myPsw" value="mypwd345"> <button type="button" onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w w w .j a v a 2 s .c o m var x = document.getElementById("myPsw"); var defaultVal = x.defaultValue; document.getElementById("demo").innerHTML = defaultVal; } </script> </body> </html>