Closed Thread Icon

Topic awaiting preservation: backgroundColor, borderColor, and color Please Stand Up! (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=21724" title="Pages that link to Topic awaiting preservation: backgroundColor, borderColor, and color Please Stand Up! (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: backgroundColor, borderColor, and color Please Stand Up! <span class="small">(Page 1 of 1)</span>\

 
meccaman
Nervous Wreck (II) Inmate

From: A little place called Earth
Insane since: Aug 2002

posted posted 05-09-2004 00:49

It's been a while since my last posting (...I was in the Asylum dungeons...)

I'm recursing through the DOM and I want to get the backgroundColor, borderColor, and color attributes of each element.
Getting these values using the style property seems to only work if the style has already been set.
I want to get the values regardless of how and if it's been explicitly set or not.
Is there a way of doing this? better yet, a cross browser way?

Any help is appreciated.
Thanks!

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 05-09-2004 04:27

It's been a while since I've dealt with this sort of thing, but here's what I remember: In addition to the style property (which contains data about the style applied specifically to the element), every DOM element also has something like a currentStyle property, which contains the style which is currently applied to that element. However, this property has a different name in the official DOM than in IE's implementation, and I wouldn't be surprised if it behaves a lot differently, so you're in for some browser-specific coding.

The DOM specification for retrieving information about a document's style is at http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/ . Good luck. =)


 

meccaman
Nervous Wreck (II) Inmate

From: A little place called Earth
Insane since: Aug 2002

posted posted 05-09-2004 08:17

You rock!!!
Thanks Slime!

« BackwardsOnwards »

Show Forum Drop Down Menu