Having trouble changing the background image of a div when a user hovers over a link.
Any ideas on what might be causing this issue?
<style>
#divToSwap {
background-image: url(black.jpg);
height: 150px;
width: 150px;
}
</style>
</head>
<body>
<div id="divToSwap"></div>
<div>
<ul>
<li><a href="#"
onmouseover="document.getElementById('divToSwap').backgroundImage='url(red.jpg)';"
onmouseout="document.getElementById('divToSwap').backgroundImage='url(black.jpg)';">
Red</a></li>
<li><a href="#"
onmouseover="document.getElementById('divToSwap').backgroundImage='url(blue.jpg)';"
onmouseout="document.getElementById('divToSwap').backgroundImage='url(black.jpg)';">
Blue</a></li>
<li><a href="#"
onmouseover="document.getElementById('divToSwap').backgroundImage='url(green.jpg)';"
onmouseout="document.getElementById('divToSwap').backgroundImage='url(black.jpg)';">
Green</a></li>
</ul>
</div>