Fn.extend增加Jquery自身方法

例子:
$.fn.extend({
		customInputCheck: function(o) {
        		$(this).get(0).checked = o;
        		if (o) {
            		$(this).next().addClass("checked");
        		} else {
            		$(this).next().removeClass("checked");
        		}
    }
});


PS:这样可以使用$("#aaa").customInputCheck()调用

你可能感兴趣的:(jquery)