<html>
<body>
<h2>Use select() to select the content of a Password Field</h2>
Password: <input type="password" id="myPsw" value="thgrt456">
<p>Click the button to select the content of the password field.</p>
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("myPsw").select();
}
</script>
</body>
</html>