title: What is a practical maximum length for HTML id?
body: <p>The <a href="http://www.w3.org/TR/REC-html40/types.html#type-name" rel="noreferrer">HTML spec</a> says</p>
  
  <blockquote>ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by <strong>any number of</strong> letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").</blockquote>
  
  <p>And even though the <a href="http://www.w3.org/TR/REC-html40/sgml/sgmldecl.html#h-20.1" rel="noreferrer">SGML declaration</a> of HTML 4 uses the value 65536 for NAMELEN, it notes "Avoid fixed limits."</p>
  
  <p>But surely browsers, CSS implementations, and JavaScript toolkits must have <em>some</em> limits on the length they support. What is the smallest such limit that is safe to use in a HTML/CSS/JS application?</p>