网页制作 > HTML/Xhtml > HTML元素设置焦点的方法 2014-09-06 15:29:58 脚本之家 <body <form action="" method="post" name="form1" > <input type="text" id="id" /> </form> </body> <script> function myfocus() { document.getElementById('id').focus(); } </script>