?
本文檔使用 php中文網(wǎng)手冊 發(fā)布
擴展 jQuery 元素集來提供新的方法(通常用來制作插件)。
查看這里 plugins 可以獲取更多信息。
用來擴充 jQuery 對象。
增加兩個插件方法。
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();