如何追加事件方法 addEventListener 无限追加。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 document.getElementById("letiana").addEventListener('click',function () { },false);第一个参数事件名字, 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(); function get(id){ var s=document.getElementById(id);//比如追加隐藏方法s.hide = function(){s.style.display = "none";return s;};return s;}用法:get("元素的ID").hide(); jquery easyui 的tree 控件如何 建立点击事件? ext 菜单点击显示在主面板中? javascript怎么获取网络时间 新手上路~大家帮忙~ 刷新网页而不刷新表单 js解析C#后台日期序列化的值。 网页求救: check 数组问题 急急急,请大侠帮忙 帮忙看下这段代码 .net网站如果进行xss防御 请问IE和Firefox/Chrome的问题
第一个参数事件名字,
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();
var s=document.getElementById(id);
//比如追加隐藏方法
s.hide = function(){
s.style.display = "none";
return s;
};return s;}用法:get("元素的ID").hide();