How do you update table row background color in IE using Javascript/CSS ?

Posted by giulio on Stack Overflow See other posts from Stack Overflow or by giulio
Published on 2010-04-13T05:11:07Z Indexed on 2010/04/13 5:12 UTC
Read the original article Hit count: 392

Filed under:
|
|
|

I have a table that i want to "highlight" during onmouseover/onmouseout. I already know this is required in IE but not in other browsers.

I have managed to detect the events triggering and this TR tag effectively works. (Note that the originating class "contentTableRow" doesn't seem to be causing any issues.)

class="contentTableRow" onclick="openForm('SomeID');" onmouseover="highlight('someRowID', true);" onmouseout="highlight('someRowID', false);" id="someRowID" 

All is fine and dandy, the "highlight" function fires and actually sets the appropriate class.

It's just that IE won't process the CSS class name change.

Here is a snippet of the CSS I am using to make the change.

.HighlightOn {
    cursor:pointer;
    background-color: #D1DFFF;
}

.HighlightOff {
    background-color: #E1EEFE;
}

I can see that the Class names are getting updated when I debug it, and also check it in Firebug. But it seems that IE doesn't like this usage of classes with a TR tag.. Is it the way I am structuring the class for Tables ? Any advice ?

© Stack Overflow or respective owner

Related posts about css

Related posts about table