标签: javascript
我认为这样可行:
... <input type="text" id="myText" /> ... <script type="text/javascript" language="JavaScript"> document.getElementById["myText"].focus(); </script>
答案 0 :(得分:1)
@ user1169578是正确的,请尝试:
document.getElementById("myText").focus();
http://jsfiddle.net/LZsc5/