3 ms·
qSA does a lot more than class and id selectors; those have been trivial since long before qSA came along. You can also do selection on element attributes, par
by apendleton 14y ago
qSA does a lot more than class and id selectors; those have been trivial since long before qSA came along. You can also do selection on element attributes, parent-child selections (include strict child selection with ">"), and a few other higher-order selector combinations.
Still, I don't mean to slight Sizzle, and certainly won't stop using it. It's just nice to see jQuery compete with Zepto, since apparently there's a demand for a build that small, and jQuery is better-tested and less brittle.
- dmethvin 14y agoI didn't mean to say that's _all_ you can do, but people often expect more than qSA can deliver, especially if they've been using jQuery/Sizzle for a while. Sizzle also works around bugs in qSA implementations when they exist. qSA's design shortcomings have been well documented, John Resig did a blog long ago about them [1]. The list of what you lose if you remove Sizzle is in the native selector file [2]. [1] http://ejohn.org/blog/thoughts-on-queryselectorall/ http://ejohn.org/blog/thoughts-on-queryselectorall/ [2] https://github.com/jquery/jquery/blob/master/src/selector-native.js#L4 https://github.com/jquery/jquery/blob/master/src/selector-na...