I am trying to find the attribute of an element in jquery, but it keeps returning undefined. This is the HTML I have,
<div class="item-image-wrapper">
<a href="/Money-Headphones-item?id=283751750">
<img title="Money Headphones" alt="Money Headphones" class="original-image"
src="http://t2.rbxcdn.com/ef3e40344e3d5fd021f94aaa71593c76">
<img src="http://images.rbxcdn.com/b84cdb8c0e7c6cbe58e91397f91b8be8.png" alt="New">
</a>
</div>
Firstly, how would I use jquery to find the "a" element because it has no name, then how would I find the second image of "a" and alert the attribute "alt"
I currently have:
$(data).find("a").find("img:eq(1)").attr("alt")
but it doesnt work. Can someone help please.
<a>) will help us in helping you better.