Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
35
rated 0 times [  37] [ 2]  / answers: 1 / hits: 44097  / 16 Years ago, tue, february 24, 2009, 12:00:00

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 (.).


And even though the SGML declaration of HTML 4 uses the value 65536 for NAMELEN, it notes Avoid fixed limits.



But surely browsers, CSS implementations, and JavaScript toolkits must have some limits on the length they support. What is the smallest such limit that is safe to use in a HTML/CSS/JS application?


More From » html

 Answers
20

Just tested: 1M characters works on every modern browser: Chrome1, FF3, IE7, Konqueror3, Opera9, Safari3.



I suspect even longer IDs could become hard to remember.


[#99935] Tuesday, February 17, 2009, 16 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ryder

Total Points: 473
Total Questions: 110
Total Answers: 91

Location: Northern Ireland
Member since Mon, Nov 14, 2022
2 Years ago
ryder questions
Tue, Nov 30, 21, 00:00, 3 Years ago
Fri, Jul 23, 21, 00:00, 3 Years ago
Tue, Jun 15, 21, 00:00, 3 Years ago
Thu, May 20, 21, 00:00, 3 Years ago
;