View Full Version : Changing background with "onclick"


DUANE
11-18-2004, 07:02 PM
Is there a code for changing a "color" background to an "animated" (url) background using an "onclick"?
How would I change this code:

<img src="http://img.photobucket.com/albums/v155/dupross/tiger.jpg" onClick="document.bgColor='red' ">

Many thanks.

kittycat
11-18-2004, 08:31 PM
<img src="http://img.photobucket.com/albums/v155/dupross/tiger.jpg" onClick="document.body.background='red.gif' ">

DUANE
11-18-2004, 11:41 PM
That's great! Worked like a charm. Much appreciated.

How about this "onmouseover". Can it be changed from a "color" background to an "animated" (url) background:

<td style="background-color:aqua;" onmouseover="style.backgroundColor='blue';"
onmouseout="style.backgroundColor='#ffcccc' ">

kittycat
11-19-2004, 01:40 AM
<td style="background-color:aqua;" onmouseover="style.backgroundImage='URL(blue.gif)';" onmouseout="style.backgroundColor='#f fcccc' ">

try that.