请教元素对象的事件名是否可写成变量,火狐可以,不知道ie怎么写
请问元素对象的事件名是否可写成变量,火狐可以,不知道ie如何写
------解决方案--------------------
都可以啊 ie7dao9试了下没问题啊
------解决方案--------------------
IE试下用
box.attachEvent(type , function(e){
alert('here!')
});
------解决方案--------------------
缺少 <body> 标签
var box=document.getElementById('div01');
var type='onclick';
box[type]=function(e){
alert('here!')
}
------解决方案--------------------
都可以啊 ie7dao9试了下没问题啊
------解决方案--------------------
IE试下用
box.attachEvent(type , function(e){
alert('here!')
});
------解决方案--------------------
缺少 <body> 标签