Ok... This works:
<td onClick="this.bgColor='#DDDDDD'">
Or this...
<td onMouseOver="this.bgColor='#DDDDDD'">
Whatever floats your boat.
I want to change the background image, though.
Since this works:
<td background="image.jpg">
I figured this would work:
<td onMouseOver="this.background='image.jpg'">
It doesn't. So I tried defining a style like this:
<td style='background: url(image.jpg);'">
Which works, but when I try to make it work with an event handler the way bgcolor works, it doesn't work. What I have is this:
<td onMouseover="this.style='background: url(image.jpg);'">
What the heck am I doing wrong? Is javaScript simpy not able to manipulate images like it does colors?
Dispensing quality rants and mishaps since 1999:
<td onClick="this.bgColor='#DDDDDD'">
Or this...
<td onMouseOver="this.bgColor='#DDDDDD'">
Whatever floats your boat.
I want to change the background image, though.
Since this works:
<td background="image.jpg">
I figured this would work:
<td onMouseOver="this.background='image.jpg'">
It doesn't. So I tried defining a style like this:
<td style='background: url(image.jpg);'">
Which works, but when I try to make it work with an event handler the way bgcolor works, it doesn't work. What I have is this:
<td onMouseover="this.style='background: url(image.jpg);'">
What the heck am I doing wrong? Is javaScript simpy not able to manipulate images like it does colors?
Dispensing quality rants and mishaps since 1999: