View Full Version : TD background in firefox

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.

07-30-2006, 09:16 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

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


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