 <p>You could try to put it in a document.ready call. And as Samuel Reid pointed out, a hover function is what you need. Like so:</p> <pre><code>$(document).ready(function () { $('.baixo-tudo').find('.botao').each(function (i) { var imge = $('img'); var t = $('.botao'), src1 = t.find('.src1').text(), src2 = t.find('.src2').text(); imge.hover(function () { t.attr('src', src1); }, function () { t.attr('src', src2); }); }); }); </code></pre> <p>EDIT, building on your fiddle.</p> <p>I am guessing <a href="http://jsfiddle.net/NnUe6/5/" rel="nofollow">this</a> is what you want?</p> <pre><code>$('.baixo-tudo').find('.botao').each(function (i) { var t = $(this), imge = t.children("img"), src1 = t.children('.src1').text(), src2 = t.children('.src2').text(); imge.mouseover(function () { imge.attr('src', src1); }); imge.mouseout(function () { imge.attr('src', src2); }); }); </code></pre> <p>And even <a href="http://jsfiddle.net/NnUe6/6/" rel="nofollow">shorter</a>.</p> <pre><code>$('.baixo-tudo').find('.botao').each(function (i) { var t = $(this), imge = t.children("img"), src1 = t.children('.src1').text(), src2 = t.children('.src2').text(); imge.hover(function () { imge.attr('src', src1); }, function () { imge.attr('src', src2); }); }); </code></pre>