[jQuery Note]Managing jQuery chains

 

Code Description Example
end(); Used with a chain of jQuery methods to back up the current wrapped set to a previously returned set. example 1

example 1

$('img').filter('[title]').hide().end().addClass('{border:4xp}');

I was wondering,shall I write like this:

$('img').addClass('{border:4xp}').filter('[title]').hide();

Yes,I tested and was success.But in my opinion,the first selector returns the wrapped set of images that

exclusives the hidden one,however,the other selector returns the wrapped set of hidden image elements.

你可能感兴趣的:(jquery)