方式: 通过拓展在调用$()时返回的包装器
1.将函数绑定到$.fn
$.fn.disable = function(){
return this.each(function(){
if (typeof this.disabled != 'undefined') this.disabled = true;
});
}
2.调用
$("#myid input").disable();
note: release JQuery in Action
方式: 通过拓展在调用$()时返回的包装器
1.将函数绑定到$.fn
$.fn.disable = function(){
return this.each(function(){
if (typeof this.disabled != 'undefined') this.disabled = true;
});
}
2.调用
$("#myid input").disable();
note: release JQuery in Action