PDA

View Full Version : Highlight specific cells in a table onclick



Ekim
05-30-2006, 10:58 PM
Hi, Im something of a newbie to webdesign in general and was trying to see if it is possible to accomplish something. I have created a table that can be found at:
http://www.pokerforumsite.com/startinghandstest.htm
and am using the "tip message" script to pop a message box, but to further customize it I wanted to highlight specific cells when any of the populated cells are clicked on.
The effect im trying to accomplish would involve 4 colors highlighting/replacing background for cells in different parts of the table when any cell is clicked.

Now since im already using <a href="javascript:(void(0);)" onMouseOver="stm(Text[16],Style[5])" onMouseOut="htm()"> in all of these cells to get the tip message im thinking this would mean I should add an onclick command to change the background.
Where I get lost is:
A)how do I define the cells in which I want the background to change
B)Is it possible to have different backgrounds applied to different cells on a single click event?
C)And is there anyway to reset the changes applied by this script each time the next cell is clicked... basically having only one group of changes active?
D)Do I need to create a script file to do this, or can I do this kind of editing right in the code I insert in each cell?

Any help that points me in the right direction would be greatly appreciated. Im a little lost as to how to even get started on this.

Thanks