Posted By

danbeam on 11/05/10


Tagged

css javascript strip ie6 manipulation


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

wirenaught


Strip CSS in all browsers (including IE6)


 / Published in: JavaScript
 

  1. (function (all, el, i, l) {
  2. for (i = 0, l = all.length; i < l && el = all[i]; ++i) {
  3. if (/style/i.test(el.nodeName) || (/link/i.test(el.nodeName) && 'stylesheet' === el.getAttribute('rel'))) {
  4. el.parentNode.removeChild(el); --l;
  5. }
  6. else if (null !== el.getAttribute('style')) {
  7. el.removeAttribute('style');
  8. }
  9. }
  10. })(document.all || document.getElementsByTagName('*'))

Report this snippet  

You need to login to post a comment.