javascript 怎么用if判断文本框是否获得焦点
if(Myform.document.getElementById("accountid").focus()){
document.all.accountidDiv.style.display = "none";
}
这样对嘛??
我是新手
谢谢
if(Myform.document.getElementById("accountid").focus()){
document.all.accountidDiv.style.display = "none";
}
这样对嘛??
我是新手
谢谢
var flag = false;
在Myform.document.getElementById("accountid")得到焦点时,把这个标记设置为true,失去焦点时为false
Myform.document.getElementById("accountid").onfocus=function(){flag = true;};
Myform.document.getElementById("accountid").onblur=function(){flag = false;};