Are data attribute css selectors faster than class selectors?

I wouldn’t call it conclusive, but it does appear class selectors are faster… I just put this together for a quickie test.

http://jsperf.com/data-selector-performance

EDIT:

Based on Vlad’s and my jsperf tests… if performance is a concern (especially IE)… classes are still the way to go

Leave a Comment