?
? ????? PHP ??? ???? ??? ?? ??
擴(kuò)展 jQuery 元素集來提供新的方法(通常用來制作插件)。
查看這里 plugins 可以獲取更多信息。
用來擴(kuò)充 jQuery 對(duì)象。
增加兩個(gè)插件方法。
jQuery.fn.extend({ check: function() { return this.each(function() { this.checked = true; }); }, uncheck: function() { return this.each(function() { this.checked = false; }); } });
$("input[type=checkbox]").check(); $("input[type=radio]").uncheck();