I’m thinking of using HTML5 data attributes for easier third-party scripting of my application. So, consider two cases:
- There are 10'000 HTML elements on page like
<div>Sticker</div>
. - There are other 10'000 HTML elements like
<div data-id="{{id}}" data-category="{{category-id}}">Sticker</div>
.
The second case (presence of attrs) probably affects DOM / rendering performance, doesn’t it? If so, how much?
Just to clarify, I don’t plan to use data attributes on my own, just exposing them for third-party scripts or browser addons. Consider dotjs or so. With data attributes it’s very easy to scrape / crawl page.