In InternetExplorer you can use .currentStyle
instead of .style
. In other browsers, you can use the getComputedStyle
mechanism.
var yourElement = document.getElementById('whatever');
var theStyle = window.getComputedStyle(yourElement);
You can then call .getPropertyValue()
on the returned style object to find the CSS properties you're interested in.