Return to Snippet

Revision: 5088
at February 11, 2008 08:52 by micmath

Initial Code
function measure(el, styleProp) {
    if (el.currentStyle)
         var st = el.currentStyle[styleProp];
    else if (window.getComputedStyle)

    var st = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
    return st;

Initial URL

Initial Description
Gets the style property as rendered, not as defined (which can be different).

Initial Title
Get the actual style property value of an element

Initial Tags

Initial Language