Posted By

Ashung on 11/08/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

romainsauger


getStyle


 / Published in: JavaScript
 

URL: http://www.quirksmode.org/dom/getstyles.html

  1. function getStyle(element, styleProp) {
  2. if (element.currentStyle) {
  3. var value = element.currentStyle[styleProp];
  4. } else if (window.getComputedStyle) {
  5. var value = document.defaultView.getComputedStyle(element, null).getPropertyValue(styleProp);
  6. }
  7. return value;
  8. }

Report this snippet  

You need to login to post a comment.