Is a colon : character valid an attribute name in HTML(5)?
Like this:
<p he:llo="world" >Hello world</p>
After searching the web I found this article:
http://razzed.com/2009/01/30/valid-characters-in-attribute-names-in-htmlxml/
That says it's valid, but he links to this w3-document:
http://www.w3.org/TR/2000/REC-xml-20001006#NT-Name
But this article is entitled "Extensible Markup Language (XML) 1.0 (Second Edition)" - meaning, XML and not HTML.
Could anyone clarify this for me?
This is used for XML namespaces and should not be used for other purposes as per that document you referenced:
The Namespaces in XML Recommendation [XML Names] assigns a meaning to names containing colon characters. Therefore, authors should not use the colon in XML names except for namespace purposes, but XML processors must accept the colon as a name character.
HTML5 supports both an XML mode and a non-XML mode. I would stay away from colons except as namespace delimiters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With