<body>
<div id="haha">
123
</div>
<script>
Object.prototype.bind=function(e,fun){
    try{
        this.addEventListener(e,fun,false);
    }
    catch(error){
        this.attachEvent('on'+e,fun);
    }    
}Object.prototype.unbind=function(e,fun){
    try{
        this.removeEventListener(e,fun,false);
    }
    catch(error){
        this.detachEvent('on'+e,fun);
    }     
}var haha=document.getElementById("haha");haha.bind("click",function(){
    alert("hello");
});
</script>
</body>