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>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy