More and more students like to store data in html attributes, such as
<p data-info="{a:1,b:2}">xxx</p>
A bunch of JSON data is placed in data-info. Is there a length limit for stored attribute values? If there is a maximum length what is it?
View from the specifications of HTML4 and HTML5 respectively.
Section 3.2.2 introduces Attribute, which does not mention the length limit.
HTML4 is derived from SGML. Let’s see if SGML has any regulations in this regard.
It seems that the maximum is 65536.
3.2.3.1 Attributes There is no mention of length display.
Of course, testing with various browsers is the best conclusion.
Related:
http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2.2
http://www.w3.org/TR/html401/sgml/sgmldecl.html
http://www.highdots.com/forums/html/length-html-attribute-175546.html