document.getElementById("d").focus();
结果代码在 IE 中不起作用,要让 IE 中也获得焦点,得用类似如下的代码:
代码如下:
document.body.onload = function(){
document.getElementById("d").focus();
}
代码如下:
document.body.onload = function(){
document.getElementById("d").focus();
}