Here is the code snippet I am working with:
<div id="popupContactIMG_4179" class="xxxx">
<a id="popupContactCloseIMG_4179">x</a>
<img alt="" src="../IMG_4179.jpg" id="id1">
</div>
I am trying to retrieve the img
id that is nested inside the <a>
element when the <a>
element is clicked:
$("a[id^=popupContactClose]").click(function(){
var imgId = $(this+" img").attr("id");
}
Can anyone provide assistance with this issue?