by smilekzs · 1y ago · 0 comments
I vaguely remember (from 10+ years ago) that class selectors are much more performant than property selectors?
The TL;DW is: yes, class selectors are slightly more performant than attribute selectors, mostly because only the attribute _names_ are indexed, not the values. But 99% of the time, it's not a big enough deal to justify the premature optimization. I'd recommend measuring your selector performance first: https://developer.chrome.com/docs/devtools/performance/selec...