您的位置: 首页 > IT文章 > HTML元素设置焦点的方法 HTML元素设置焦点的方法 分类: IT文章 • 2023-10-28 11:57:11 复制代码代码如下: <body <form action="" method="post" name="form1" > <input type="text" id="id" /> </form> </body> <script> function myfocus() { document.getElementById('id').focus(); } </script>