Edit The Code:
See Result »
Try it Yourself - ©
w3big.com
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>本教程(w3big.com)</title> <script> function myFunction(){ document.getElementById("pwd").select(); } </script> </head> <body> <form> 密码: <input type="password" id="pwd" value="thgrt456"> </form> <button type="button" onclick="myFunction()">选中内容</button> </body> </html>