using jquery, how do you change the image on hover inside of a div
- by oo
i have the following jquery code to replace an image when you hover over with the mouse but it doesn't seem to be working. Can anyone find anything wrong with this code below.
$(function() {
$("div.delete img")
.mouseover(function() {
$(this).attr("src", "../../images/comment-hover-del.png");
})
.mouseout(function() {
$(this).attr("src", "../../images/comment-del.png");
});
});
and this is my html:
<div class="delete" id="26"><img src="../../images/comment-del.png" border="0"></div>