Possible Duplicate:
styling XML (not HTML) with javascript & css after rendering in browser
Is it possible to access the CSS-styled properties of an XML document being displayed in a browser?
The element is accessible using, say, .getElementsByTagName(). And the browser correctly applies the CSS styling. And the debug panel (Firebug in FF, Dev Tools in Chrome) report the styles. So the data is in there somewhere.
But all these return either null or undefined:
document.getElementsByTagName("pb")[1].style
document.getElementsByTagName("pb")[1].css
document.getElementsByTagName("pb")[1].getAttribute('style')
document.getElementsByTagName("pb")[1].getAttribute('css')
Does the DOM not expose the styling?
Update: The open question asks about changing the styling. This one asks only about accessing the styling.
If in fact, read-only access is all that's needed, use .getComputedStyle().
document.getElementsByTagName("pb")[0].style? Using an index of1as in the question gets you the second element...