How to get child element by jQuery

摘要:How to get child element by jQuery

The jQuery constructor accepts a 2nd parameter which can be used to override the context of the selection.


ex:

<div id="..."><img src="..."></div>

 

To get the div, we could got this selector:

$(this)

 

How to get the img with a selector?

 

 

jQuery("img", this);
or
$("img", this);