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

javascript, performance

Solution

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.

Problem

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

Original source

Related problems