HTML5 spec has no limit on the amount of data in an attribute:
... without restrictions on the depth of the generated DOM tree or on the length of tag names, attribute names, attribute values, text nodes, etc.
The time taken to render the page depends on the length of the content, and thus any added content, such as a lot of data stored in attributes, will cause the page to load slowly. Retrieving data using javascripts getAttribute() will also be slower if the data is massive.
With ajax or / and a server storage solution, you can retrieve data as needed, making it much faster in many cases than storing everything in HTML.
How much is? It depends on what you are doing with the data, what data, etc., and it is almost impossible to answer. You, as a developer, will have to decide what to use, etc.
source share