window.onload 这句错了,这个是页面一加载就执行,这个时候 textbox还没生成,应该改成这样:
<script type="text/javascript" defer="defer">
function () {
var oInput = document.getElementById("CodeTextBox");
oInput.focus();
}
</script>
这样的意思是页面加载完毕才执行
<script type="text/javascript" defer="defer">
function () {
var oInput = document.getElementById("CodeTextBox");
oInput.focus();
}
</script>
这样的意思是页面加载完毕才执行
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货