Hello!
I have this HTML markup
<a href="#" title="">
<img src="#" title="image1" />
</a>
<a href="#" title="">
<img src="#" title="image2" />
</a>
<a href="#" title="">
<img src="#" title="image3" />
</a>
and I need to take the title of each image and put it on their "a". I tried to do it with this function
$(function() {
var title = $('a').find('img');
var updateTitle = title.attr('title');
$('a').attr({
title: updateTitle,
alt: 'lol'
});
});
But the only result is the same title for all "a" (the first title he finds)
Any help????
Thank you very much