Ok coders! I am new to all this programming stuff and really grateful for yalls help. I have a onmouseover event that changes the background image of a div. It also has an onmouseout that switches the div back ground image back to the default image. Easy stuff. What I am wondering is if someone could help me modify my code to where it works on multiple divs with different images. Right now I have it set up to only work on one div. If you can help, THANKS FOR YOUR TIME!!!!
CODE:
<script>
function overDiv(d) { document.getElementById(d).style.background=”url(‘image1’)”; }
function outDiv(d) { document.getElementById(d).style.background=”url(‘image2’)”; }
</script>
<div id=”d1″ onmouseover=”overDiv(‘d1’)” onmouseout=”outDiv(‘d1’)”></div>
This works great, but I need it to work on multiple divs with different background images. Thanks for your time and have a great day!