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();  
});
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s