Invalid Property Error in IE6 for style.color = “grey”

By Vincent on December 23, 2010

Just hit a small error in IE 6 with some javascript that was trying to change the color of some text to “grey”. The offending line of code was the following:


if(document.getElementById(labelID)!=null)

document.getElementById(labelID).style.color = "grey";

Here labelID was the id of the <code>&lt;span&gt;</code> that surrounded the text I wanted to grey out.

So the fix here is to change the color value “grey” to “gray”. Damn you alternate spelling!

Leave a Reply

Add a Comment »

Force.com Development