View Full Version : Change the background of an empty table cell when a link on other cell is clicked

11-20-2005, 04:23 PM
Hi ,

Can anybody suggest as to how to go about when--

the background of an empty table cell has to be changed when a hyperlink on another table cell is clicked.

The background has to be changed either by using colour/image or class .


Jim D'Amato
12-18-2005, 02:38 AM
Try something like this:

<table width="200"><tr>
<td id="empty" width="100">
<td width="100"><a href="#" onclick="document.getElementById('empty').style.backgroundColor = 'red';">Click the link</a></td></tr></table>

When you click the link the background of the other table cell should change to red.


12-25-2005, 11:38 AM
cant remember where it was, but there was a javascript forum post here on dd about how to do this, i think the answer i used was given by jscheurer on that thread (like i said, cant remember which, try searchin for it)