Learn how to use $(this) selector and children
If you want to select img tag and modify values of it. <div id=”known_id”><img src=”…”></div> The jQuery constructor accepts a 2nd parameter which can be used to override the context of the selection. $(‘#known_id’).click(function(){ var img = jQuery(“img”, this); }); Which is the same as $(‘#known_id’).click(function(){ var img = jQuery(this).find(“img”); }); If the imgs are […]
Continue Reading →