4 ms·
This is actually a great example of the purpose of the site. Since IE8, browsers have supported a native 'sizzle-style' element querying syntax: http://youmigh
by sfeng 13y ago
This is actually a great example of the purpose of the site. Since IE8, browsers have supported a native 'sizzle-style' element querying syntax: http://youmightnotneedjquery.com/#finding_elements http://youmightnotneedjquery.com/#finding_elements
IE9 and later also support a native each. You are correct however that you'd have to use Array.prototype.each.call, because the NodeList is not a real array.
- exizt88 13y agoResig on document.querySelectorAll: http://ejohn.org/blog/thoughts-on-queryselectorall/ http://ejohn.org/blog/thoughts-on-queryselectorall/ Good SO discussion on this topic: http://stackoverflow.com/questions/11503534/jquery-vs-document-queryselectorall http://stackoverflow.com/questions/11503534/jquery-vs-docume...
- tghw 13y agoIt's still more complex, because you still have to iterate over it.