I am trying to get the second image inside the div. My structure is like
<div class='test'>
<a href='#'> <img src='haha.jpg'/> </a>
<a href='#'> <img src='imageINeed.jpg'/> </a>
</div>
<div class='test'>
<a href='#'> <img src='haha.jpg'/> </a>
<a href='#'> <img src='imageINeed1.jpg'/> </a>
</div>
<div class='test'>
<a href='#'> <img src='haha.jpg'/> </a>
<a href='#'> <img src='imageINeed2.jpg'/> </a>
</div>
My jquery below won’t work
$('.test').find('img:last').each(function(){
$(this).css('max-width','none').width(500);
})
I want to select the second image inside every test div. Can anyone help me about it? Thanks!
How about this: