addEventListener  无限追加。

解决方案 »

  1.   

    document.getElementById("letiana").addEventListener('click',function () { },false);
    第一个参数事件名字,
      

  2.   

    function get(id){
     this.s=document.getElementById(id);
    //比如追加隐藏方法
    this.s.hide = function(){
    obj.style.display = "none";
    return this.s;
    };
    }用法:get("元素的ID").hide();
    也可以利用原型追加:Element.prototype.hide=function(){
    obj.style.display = "none";
    return this.s;
    }这样就是所有的dom对象都有了该方法。
    用发:document.getElementById("letiana").hide();
      

  3.   

    function get(id){
     var s=document.getElementById(id);
    //比如追加隐藏方法
    s.hide = function(){
    s.style.display = "none";
    return s;
    };return s;}用法:get("元素的ID").hide();