How to use HTML DOM Password select in JavaScript

In this article I am going to explain about password select method in JavaScript.
  • 1579

HTML DOM password select method

The password object select method is used to select the content of a password field.

Syntax of password select method

passwordobject.select()


Browser support

The password select method  is supported in all major browser.

Example of password select method

<!DOCTYPE html>

<html>

<head>

<script type="text/javascript">

    function PwdFunction() {

        document.getElementById("password").select();

    }

</script>

</head>

<body>

<form>

Password: <input type="password" id="password" value="dotnet123" />

</form>

<button type="button" onclick="PwdFunction()">Select Password</button>

</body>

</html>

Output:

select pass new meth.jpg

You may also want to read these related articles :here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.