When setting css attributes from javascript (and hence also GWT), you
must use camel case. That means "backgroundColor" instead of
"background-color".

You might also like to use the Style object, so you can write (IIRC):

getElement().getStyle().setProperty("backgroundColor", color);

better still (although I suspect only with trunk):

getElement().getStyle().setBackgroundColor(color);



Paul

bconoly wrote:
> I'm trying to dynamically set the background-color of a div with a set
> width and height using the HTML.getElement.setAttribute("style",
> "background-color:" + color) method and it works fine in firefox but
> IE for some reason isn't getting the style attribute added to the div
> element.  Does anyone have any idea why that is and how I may be able
> to fix it?
> Thanks in advance
> >
>
>   

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to