Case Sensitivity of HTML5, XML, CSS, JavaScript

By Xah Lee. Date: . Last updated: .

{HTML4, HTML5} → No

HTML4, HTML5: tag names and attribute names are NOT case sensitive. You can write <DIV cLAss="…">…</div>.

{XHTML, XML} → Yes

XHTML, XML: case sensitive, and must be all lowercase.

Attribute Values → Yes

Attribute values (example: id="value", class="value"), in HTML and XML are case sensitive.


JavaScript → Yes

JavaScript identifier (variable and function name) is case sensitive. [see JavaScript Basics]

Allowed Characters in Attribute Names

HTML: Allowed Characters in id Attribute

Allowed Characters in JavaScript Identifiers

JS: Allowed Characters in Identifier

HTML Basics

  1. HTML Basics
  2. HTML5 Tags
  3. Case Sensitivity
  4. Allowed Characters
  5. Charset and Encoding
  6. Self-Closing Tags
  7. Multiple Class Value
  8. HTML/XML Entity List
Liket it? I spend 2 years writing this tutorial. Help me spread it. Tell your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS in Depth
  4. JS Object Ref
  5. DOM Scripting
  6. SVG
  7. Blog