JS Framework that doesn't use CSS selectors?
- by RoToRa
A thing that I noticed about most JavaScript frameworks is that the most common way to find/access the DOM elements is to use CSS selectors.
However this usually requires the framework to include a CSS selector parser, because they need to support selectors, that the browser natively doesn't, foremost the frameworks own proprietary extensions.
I would think that these parsers are large and slow. Wouldn't it be more efficient to have something that doesn't require a parser, such a chained method calls?
Some like:
id("example").children().class("test").hasAttribute("href")
instead of
$("#example > .test[href]")
Are there any frameworks around that do something like this? And how do they compare with jQuery and friends in regard to performance and size?
EDIT: You can consider this a theoretical discussion topic. I don't plan to use anything other than jQuery in any practical projects in near furure. I was just wondering why there aren't any other, possibly better approaches.