Jquery — Selectors. Select one child element

Finally, found a reference to my favorite method.

I needed something that traverses the DOM DOWN, not UP, but behaves like $.closest and $.parents

That is: $(TYPE, $JQUERY)

For an image inside a div you’re clicking:

$("div").click(function() { 
   $('img', this).show();  
});

Leave a Comment