方法:1:js控制自动获取焦点
<html> <head> <script type="text/javascript"> function setFocus() { document.getElementById('password1').focus() } function loseFocus() { document.getElementById('password1').blur() } </script> </head> <body> <form> <input type="password" id="password1" value="thgrt456" /> <input type="button" οnclick="setFocus()" value="Set focus" /> <input type="button" οnclick="loseFocus()" value="Lose focus" /> </form> </body> </html>方法2:css 控制 自动获取焦点
<input type="tel" autofocus="autofocus"> <!--这一行代码其实就够了!-->