|
Hi there,
I'm quite new with javascript.I would really appreciate your help.
I'm trying to change the background(located in my css file) of my page using onmouseover event but it does not work.
How can I access the background from my css file??
This is what I have done so far.......
function bgChange(bg)
{
document.stylesheet.body.background=bg
}
</script>
<body>
<table>
<tr>
<td onmouseover="bgChange('/forum/misc372.jpg')"
onmouseout="bgChange('/forum/misc362.gif')"
background="/forum/misc372.jpg">
</td>
<tr>
<td onmouseover="bgChange('/forum/misc324.jpg')"
onmouseout="bgChange('/forum/misc362.gif')"
background="/forum/misc324.jpg">
</td>
<tr>
<td onmouseover="bgChange('/forum/misc022.jpg')"
onmouseout="bgChange('/forum/misc362.gif')"
background="/forum/misc022.jpg">
</td>
<tr>
<td onmouseover="bgChange('/forum/misc363.gif')"
onmouseout="bgChange('/forum/misc362.gif')"
background="/forum/misc363.gif">
</td>
<tr>
<td onmouseover="bgChange('/forum/misc362b.gif')"
onmouseout="bgChange('/forum/misc362.gif')"
background="/forum/misc362b.gif">
</td>
</tr>
</table>
</body>
</html>
Please help.What am I doing wrong???
|
|
|
|
|
|
|
|