Re: Get All Element Styles inside javascript

Martin Honnen <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Organization Liberty Development
Message-ID <[email protected]>
krithika wrote:
> I would like to know if I can get all styles of an element ( from
> style node , external css and inline css) inside javascript.
> 
> Iam able to get individual styles from
> document.defaultView.getComputedStyle(x,null).getPropertyValue
> (styleProp); as shown
> 
> 
> Is it possible to list all style properties configured and then get
> the values?.

I don't think so. Even if the document itself does not define a property 
for a certain element there is nevertheless a value applied as there is 
a user agent stylesheet and maybe a user stylesheet too. I don't think 
there is an API allowing to access only those properties for which the 
document itself defines styles.

-- 

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.