View Full Version : Changing the background color of a table cell onFocus

Packet Dropped
05-02-2006, 12:27 AM
I've an application I wrote months ago that generates html files mostly
containing tables with thousands of cells. Each table cell contains a uniquely
named anchor and a third-party application calls the browser with the
html file name and specified anchor. like file:///C:/perl_apps/HTML.htm#BX45222.

Each cell begins like this

<td onblur="bgColor='lightgrey';" bgcolor="lightgrey" onfocus="bgColor='lightgreen';">
<a name="BX45222."></a>

In the past this work as planned with the cell of interest highlighted in lightgreen. Now
this no longer works with Firefox. It still renders appropriately with Internet
Explorer. If there's an portable way to turn the back ground color of a cell
a different color by referencing a document anchor I'd like to know.


05-02-2006, 02:24 AM
It doesn't work in firefox because its not the correct JS for background color

onfocus="this.style.backgroundColor = 'lightgreen';" onblur="this.style.backgroundColor = 'lightgrey';"