Linked Questions
27 questions linked to/from Is there a limit to the length of HTML attributes?
5 votes
2 answers
4k views
How much data is it okay to put on a data attribute in the dom? [duplicate]
Sometimes I'd like to put a decent amount of data on the page to avoid extra AJAX calls for dynamic content. I wonder while doing so if there is a performance penalty I should be cautious of.
-1 votes
2 answers
10k views
What is the limit of character to use in alt=“text” of img tag in html [duplicate]
Please tell me if there is any any specific number of characters that can be entered in alt attribute of img tag of html
5 votes
0 answers
69 views
Is there a size limit for data- attributes? [duplicate]
Possible Duplicate: Is there a limit to the length of HTML attributes? I want to use data- attributes to pass JSON between scripts on a Web page. For example a div tag could look like this: <...
0 votes
0 answers
26 views
Limit of characters inside tag property [duplicate]
It's a simple question, but I can't find the answer searching. if I have this: <option value="">Test</option> What's the limit of characters of text that I can put inside the ...
143 votes
7 answers
70k views
Best practice for embedding arbitrary JSON in the DOM?
I'm thinking about embedding arbitrary JSON in the DOM like this: <script type="application/json" id="stuff"> { "unicorns": "awesome", "abc": [1, 2, 3] } </script> ...
108 votes
4 answers
49k views
What is a practical maximum length for HTML id?
The HTML spec says ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."...
100 votes
9 answers
82k views
What is the difference between srcdoc="..." and src="data:text/html,..." in an <iframe>?
For example, which is the difference between these: <iframe srcdoc="<p>Some HTML</p>"></iframe> <iframe src="data:text/html,<p>Some HTML</p>"></iframe> ...
49 votes
7 answers
72k views
Max length of Title Attribute
What is the length limitation of HTML title attribute? <span title="some big long piece of text and is there any limit to its size?" /> Edit: My question is specific to title attribute not ...
48 votes
2 answers
174k views
multiple classes on single element html [closed]
Is it a good practice to use many classes on one single HTML element? For example: <div class="nav nav-centered nav-reversed navbar navigation-block"></div> I don't mean that two or three ...
28 votes
3 answers
38k views
CSS: Is there a limit on how many classes an HTML element can have?
CSS allows an HTML element to have multiple classes: <div class="cat persian happy big"> Nibbles </div> But is there a limit on how many classes are allowed per item?
9 votes
3 answers
16k views
Max length of an HTML attribute value
How would I know what the maximum length of an element's attribute value is? e.g. <div id="value1..."></div> What's the maximum allowable length for ID attribute of this div and any ...
11 votes
3 answers
11k views
Can I use a UUID for a HTML tag ID without any issues?
I have dynamic content which is accessible via a index on a side pane, when the user selects a side pane element, I use the id as a mechanism to figure out what data they're referring to, so I can ...
7 votes
2 answers
8k views
data-attributes is there a limit of length and how many?
Is there a limit on html's data-attribute? Is it possible to have many data-attributes on a tag? ex. data-a="" data-b="" data-c="" ... data-z="" And also is there a limit how long the value on each ...
3 votes
4 answers
4k views
Maximum length of a html title
Does anyone know what is the maximum length I can enter for the html title attribute and whether special characters are allowed?
3 votes
1 answer
4k views
Populate select (drop down) with data from API after .map using vanilla JS
I am stuck on a problem. I am using code that looks something like the following to populate a select with data but I am not getting the expected result. let data = await response.json(); let result = ...