Javascript examples for DOM HTML Element:Input Password
The select() method selects the content of a password field.
None.
No return value.
The following code shows how to Select the content of a password field:
<!DOCTYPE html> <html> <body> Password: <input type="password" id="myPsw" value="thgrt456"> <button type="button" onclick="myFunction()">Test</button> <script> function myFunction() {// www. ja va 2 s. com document.getElementById("myPsw").select(); } </script> </body> </html>