Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> Password: <input type="password" id="myPsw" value="thgrt456"> <p>Click the button to alert the default value of the password field.</p> <button type="button" onclick="myFunction()">Try it</button> <script> function myFunction() { var x = document.getElementById("myPsw").defaultValue; alert(x); } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_password_defaultvalue by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:33:17 GMT --> </html>
Result:
Try it Yourself - © w3schools.com