4 ms·
.tagName evaluates to the name of the HTML 4 element, and names are written all-caps in the HTML 4 and older specifications. All-caps is convenient because you
by Daniel_Newby 17y ago
.tagName evaluates to the name of the HTML 4 element, and names are written all-caps in the HTML 4 and older specifications. All-caps is convenient because you can write about, for example, the A element by just typing its name. The standards committees renamed them to lowercase for XHTML and HTML 5, because writing about 'a' elements is ever so much more consistent. Morons.
P.S. In HTML 4 and older, tags are case insensitive. And practical browsers will accept both cases for the foreseeable future.