如何在表单控件外部添加事件函数?
想在 <input> 外面添加表单控件事件的响应函数,不知道怎么弄,
比如 <input name= "ip1 " onChange= " ">
我现在想在外边添加onChange,应该怎么弄呢?
我试了document.form1.ip1.onChange= " ";但不起作用
------解决方案--------------------
document.getElementById( "ip1 ").onchange=function(){
alert( "haha ")
}
------解决方案--------------------
注意大小写
查询谷 - www.chaxungu.com
怎么在表单控件外部添加事件函数
编辑:chaxungu时间:2022-10-02 23:23:21分类:web开发