Im getting data out of a database, and based on the number of matches, I want to output this:
<div id='link_delete_holder' style='position:absolute;left:590px;top:10px'>
<img id='link_delete' src='images/account_related/icons/link_delete.png'/>
</div>
I want that image to be changing on hover, so I use this code:
$('#link_delete').hover(function(){
$(this).attr('src', 'images/account_related/icons/link_delete_h.png');
}, function(){
$(this).attr('src', 'images/account_related/icons/link_delete.png');
});
Now, the problem is it only works on the first record (the first link_delete image that gets displayed), and seems like it doesn't apply to other images.