I’m sure this is a very simple script but I have very little experience in JavaScript. I am trying to learn it and I would appreciate it if you help me create this effect ?.
Style.css
[code]#test{
background-image:url(images/bg1.gif);
height:100px;
width:100px;
}
and I imagine the HTML would look something like this, with the Javascript I have so far.
[code]
<html>
…
<script type=”text/Javascript”>
function changeBgImage (image , id) {
var element = getDocumentByID(id);
element.style.background-image = url(image);
}
</script>
<body>
<div id=”test” onMouseOver=”changeBgImage(‘images/bg2.gif’,’test’)”>
</div>
</body>
</html>
That’s basically it. Any help is appreciated.