Skip to content

Instantly share code, notes, and snippets.

@indapublic
Created September 2, 2014 00:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indapublic/a5c2b75a42c9874f65fc to your computer and use it in GitHub Desktop.
Save indapublic/a5c2b75a42c9874f65fc to your computer and use it in GitHub Desktop.
IE7 Support for querySelectorAll
// IE7 support for querySelectorAll in 274 bytes. Supports multiple / grouped selectors and the attribute selector with a "for" attribute. http://www.codecouch.com/
(function(d,s){d=document,s=d.createStyleSheet();d.querySelectorAll=function(r,c,i,j,a){a=d.all,c=[],r=r.replace(/\[for\b/gi,'[htmlFor').split(',');for(i=r.length;i--;){s.addRule(r[i],'k:v');for(j=a.length;j--;)a[j].currentStyle.k&&c.push(a[j]);s.removeRule(0)}return c}})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment