I have a foreach loop in jQuery going through each ‘div.panel’, I need to access the img src of the image within this div…
HTML:
<div class="panel" title="Sean Gay">
<div class="wrapper"><img src="/Media/people/SeanGay.jpg" alt="Sean Gay" class="person">
<div class="vcard"><span class="fn">Sean Gay</span> <span class="title">Chief Storeman</span>
</div>
</div>
</div>
jQuery:
jQuery(this).find("div.panel").each(function(n) {
var title = jQuery(this).attr("title");
This gets me the title of the panel, within this loop I need the src of the image in the wrapper without the .jpg extension.
How can I do this?
This is just basic traversal and string manipulation: