点击“确定”后,如何实现光标在密码框?方便直接输入密码
<!DOCTYPE HTML> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> 鼠标经过事件 </title> <script type="text/javascript"> function message(){ var ret = confirm("请输入密码后,再单击确定!"); if(ret){ document.getElementById('psd').focus() } } </script> </head> <body> <form> 密码:<input name="password" type="password" id="psd"> <input name="确定" type="button" value="确定" onmouseover="message()"/> </form> </body> </html>
focus