[X]

The IMAGE Tag That Is Not There

parser and markup 1993 still works

Write IMAGE instead of IMG and the parser quietly fixes your spelling.

In 2026: Still works, by law. The HTML parser is required to treat an image start tag as img, a kindness for a typo people have been making since pictures arrived, and the spec's rule for it famously ends with the words: Don't ask. It lives only in the parser: document.createElement('image') really makes an unknown image element.

Where it came from: Tolerance for a Mosaic-era typo, now written into the WHATWG parser, where the rewrite rule ends with the words: Don't ask.
HTML parser spec MDN img

<image src="https://xbawx.com/btn/assets/7c/7cada91ec2730b0fb58b60bab3f16e67985dd27b.gif"
       alt="Written as IMAGE">

<script>
var el = document.querySelector("img");
document.write("<p style='font:13px Verdana'>The source above says &lt;image&gt;. " +
  "The DOM says &lt;" + el.tagName.toLowerCase() + "&gt;.</p>");
document.write("<p style='font:13px Verdana'><code>document.createElement('image')</code> " +
  "makes an <b>" + document.createElement("image").constructor.name + "</b>: " +
  "the kindness lives only in the parser.</p>");
</script>
sandboxed demo · breaks nothing but itselfrestart

More in parser and markup

all 6 in parser and markup › · the whole library ›