Hello,
I am trying to change the background image of an element onmouseover. Just can’t seem to get it going. Below is a link to the example that does nothing and the code.
http://www.servicewhale.com/backgroundSwitch.htm
Thanks for your help
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style>
#wrapper {
width: 150px;
height: 331px;
float: left;
background: url('grid_box.gif') left top no-repeat;
}
</style>
<script type="text/javascript">
function changeBG(x){
var NewBG = document.getElementById(x);
var highLightBG = "grid_box_highlight.gif"
NewBG.style.background = highLightBG;
}
</script>
</head>
<body>
<div id="wrapper" onmouseover="changeBG('wrapper')">
</div>
<div id="wrapper" onmouseover="changeBG('wrapper')">
</div>
<div id="wrapper" onmouseover="changeBG('wrapper')">
</div>
</body>
</html>