Is Attribute Name Case Sensitive

Q

Is Attribute Name Case Sensitive? - XHTML Tutorials - Introduction To Tag and Attribute Syntax

✍: FYIcenter.com

A

Yes, attribute names are case sensitive. You must write all attribute names in lower case letters.

Here are some valid and invalid attribute names:

  • <a href="http://dev.fyicenter.com"> - Valid attribute name.
  • <a HREF="http://dev.fyicenter.com"> - Invalid attribute name, must use lower case letters.
  • <script Type="text/javascript"> - Invalid attribute name, must use lower case letters.

Note to HTML document authors: HTML element attribute names are not case sensitive. But XHTML element attribute names are case sensitive. If you are converting existing HTML documents to XHTML documents, you will get a lots of syntax errors about upper case letters used in HTML attributes.

2007-05-12, 5441👍, 0💬