开发者

Need help understanding code

hi all i am new in jquery

this code in book jQuery in action page 219

why he use .e开发者_StackOverflow社区nd() method

and thanks :)

(function($){
$.fn.setReadOnly = function(readonly) {
return this.filter('input:text')
.attr('readOnly',readonly)
.css('opacity', readonly ? 0.5 : 1.0)
.end();
};
})(jQuery);


A jQuery function should return this to allow chaining.

Using .end() he undoes .filter('input:text') so finally he's returning the this jQuery object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜