View Single Post
Old 07-07-07, 07:37 AM   #1
technoid
Registered User
 
Join Date: Jul 2004
Location: Denton, Texas
Posts: 505
Default Table TD Background Color (javascript)

What I want to do is read the background color of a table td element, then add 101010 to it to lighten it up and then write that value to it. So far I can write a value but when I try to read it I don't get the value. I thought the background color was read/write.

I can set the color this way.

var bgclr = "#cccccc";
this.style.backgroundColor=bgclr;


But I can't read the color with this.

var bgclr=this.style.backgroundColor;

The initial background color is set in the css class.

EDIT: If I set the background color using an in-line style the read works correctly. But if I use an external css class it doesn't.
__________________
Antec-SOLO | ASUS-P5Q-SE | C2D-E8600 | AC-Freezer-7-Pro | Seasonic-S12-550W | 3GB-KVR-PC2-6400 | GTX-560Ti | SB-XtremeGamer | Pioneer-BDR-205 | Samsung-S223B | Dell-U2412M
technoid is offline   Reply With Quote