Posts
293
Comments
27
Trackbacks
206
IE DOM and style attributes

As much a reminder to myself as aid for anyone with a similar problem. I've been doing some client-side scripting, using the HTML DOM and hit a problem when accessing the attributes of an element, specifically the style attribute. IE returns this as an object, while other browsers (well, Firefox) return it as a string, in accordance with the W3C specs. In IE to get access to the string of defined values you have to use node.style.cssText. It's taken me several hours of trial an error and searching to find this - most of my search results had plenty to say about problems of setting and fetching CSS values, but not mentioned this property, which I eventually found on MSDN.

Listening to See Him on the Street by The Jayhawks from the album Tomorrow the Green Grass

posted on Monday, October 30, 2006 3:49 PM Print
Comments have been closed on this topic.