...

View Full Version : TD background in firefox



sreticentv
07-30-2006, 08:51 PM
I'm trying to dynamically change the background of a <TD> using javascript and it works in IE, but not firefox. Any suggestions would be much appreciated, here are some snippets.

The html looks like this

<TR height=24>
<TD class=topiclefttext id="Newstopic001"
background="lpnet_files/forumleft.gif" colSpan=2>....</TR>

my javascript looks like:

document.getElementById("Newstopic001").background = imagePath

in IE this works, but in firefox it doesn't.

vwphillips
07-30-2006, 09:16 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
</head>

<body>
<table cellpadding="0" cellspacing="0" border="1">
<tr>
<td width=200" style="background-image:url(http://www.vicsjavascripts.org.uk/StdImages/One.gif);"
onclick="this.style.backgroundImage='url(http://www.vicsjavascripts.org.uk/StdImages/Two.gif)';"
>1234</td>
</tr>
</table>
</body>

</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum