faqts : Computers : Programming : Languages : JavaScript : Tables

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

20 of 32 people (63%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

How do I change the colour of any text in a table cell when that cell is selected?

Aug 30th, 2000 06:11
Martin Honnen, Andy Whittle,


I am not sure I understand this question. When you select text the 
browser displays it with inverted color/background color so I am not 
sure what you want to achieve besides that effect. 
Here is an IE4+ example however that uses the 
  onselectstart
event to set the text color to red:
<TABLE BORDER="1">
<TR>
<TD ONSELECTSTART="this.style.color = 'red';">
Kibology for all.
</TD>
</TR>
</TABLE>
Check for yourself whether that is the effect you want.
If not post a detailed problem description in a relevant newsgroup.