Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!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> </html>