大神帮我看一下!这样错在哪
<input type="button" value="点我" id="o"/>
<script>
function M(){
alert('666')
}
var dw=document.getElementById("o")
var a={
b:function(c,d,e){
if(c.addEventListener){
c.addEventListener(d,e,false)
}
else if(c.attachEvent){
c.attachEvent('on'+d,e)
}
else{
c['on'+d]=e
}
}
}
a.b(dw,'click',M)