- jQuery.extend(object)
 
扩展jQuery对象本身。
- jQuery.fn.extend(object)
 
扩展 jQuery 元素集来提供新的方法(通常用来制作插件)。
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Title</title><script src="jquery3.6.js"></script></head><body><div class="c1"><input type="checkbox"><input type="checkbox"><input type="checkbox"></div><script>jQuery.extend({min:function (a,b) {return a < b ? a:b},max:function (a,b) {return a > b ? a:b}});console.log($.min(3,5));console.log($.max(3,5));jQuery.fn.extend({check:function () {console.log($(this));$(this).prop("checked",true)},cancel:function () {console.log($(this));$(this).prop("checked",false)},});$(".c1 :checkbox").cancel();</script></body></html>
