How do I change an image src on hover?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How do I change an image src on hover?

timberwillow
Here was my idea for the code, but it didn't work:

<script> $(document).ready(function() { $("#work").mouseover(function() { $('#work').attr('src' , 'images/workH.png'); }) .mouseout(function() { $('#work').attr('src' , 'images/work.png'); }); }); </script>
--------------------------

<div id="content">
<img src="images/logo.png" id="logo"/>
<img src="images/work.png" id="work"/>
</div>

Thanks in advance for your help!
Loading...