Password select() Method
Password Object
Definition and Usage
The select() method is used to select the content of a
password field.
Syntax
Browser Support

The select() method is supported in all major browsers.
Example
Example
Select the content of a password field:
<html>
<head>
<script>
function myFunction()
{
document.getElementById("pwd").select();
}
</script>
</head>
<body>
<form>
Password: <input type="password" id="pwd" value="thgrt456">
</form>
<button type="button" onclick="myFunction()">Select content</button>
</body>
</html>
Try it yourself »
Password Object
Thank You For Helping Us!
Your message has been sent to W3Schools.
Close [X]