或者
function youfunction(){
alert("ok");
}
var theObject=document.getElementsByTagName("input");//得到所有input标签
for(i=0;i<theObject.length;i++){//绑定事件
theObject[i].attachEvent("onclick",youfunction);
}
function youfunction(){
alert("ok");
}
var theObject=document.getElementsByTagName("input");//得到所有input标签
for(i=0;i<theObject.length;i++){//绑定事件
theObject[i].onclick=youfunction;
}