3 ms·
What is the performance of an attribute selector?
by amccloud 12y ago
What is the performance of an attribute selector?
- EdSharkey 12y agoThese selectors are evaluated globally, checked against to EVERY NODE in the DOM. You might as well write *[am-Button] just to hammer home to the reader that performance is going to be a problem with this selector approach on any complex DOM. If I recall, CSS performance can roughly be gauged by the key selector (right most thingy on the selector) like this: * inline styles = fastest (ok, this doesn't have a selector, but it evaluates fast!) * id = fastest-ish * class = fast * tagname = slower * any/everything else evaluated like global = super slowest