Friday, May 15, 2009

How to further filter "this" in jquery?

Suppose this is the HTML.

You can use $('div') to get it. You can refer to it by "this". What if you want to get "img"? How do you apply selector on "this"?

The jQuery constructor accepts a 2nd parameter which can be used to override the context of the selection.
$("img", this);

No comments:

Post a Comment