Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using data- attributes will affect the performance of the application?

i am planning to use data- attributes to identify elements in DOM for selenium test cases. Will the usage of attributes affects application performance?

like image 249
Amareswar Avatar asked Mar 05 '26 15:03

Amareswar


1 Answers

Not at all, you'll be fine with using data-* attributes. However, you should note that using the syntax $.data(theInput, 'someData'); is much faster than using the syntax theInput.data('someData');, as demonstrated in this jsPerf.

like image 200
Elliot Bonneville Avatar answered Mar 07 '26 05:03

Elliot Bonneville



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!