Lowercase of HTML element's nodeName

Koos Vriezen koos.vriezen at xs4all.nl
Tue Apr 23 21:21:13 BST 2002


Hi,

Just found this case difference in nodeName with konqueror current CVS:

    <html><body onLoad='alert(document.body.firstChild.nodeName)'>
      <table></table>
    </body></html>

which shows 'TABLE' and

    <html><script>
      function doIt() {
        f1.document.open();
        f1.document.write("<html><body><table></table></body></html>");
        f1.document.close();
        alert(f1.document.body.firstChild.nodeName);
      }
    </script>
    <frameset onLoad='doIt()'>
      <frame name="f1" src="about:blank">
    </frameset></html>

which shows 'table'. Quick check on
http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-F68D095
suggests uppercase:

<snip>
tagName of type DOMString, readonly
The name of the element. For example, in:

<elementExample id="demo">
        ...
</elementExample> ,
tagName has the value "elementExample". Note that this is case-preserving
in XML, as are all of the operations of the DOM. The HTML DOM returns the
tagName of an HTML element in the canonical uppercase form, regardless of
the case in the source HTML document.
</snip>

Regards,

Koos Vriezen





More information about the kfm-devel mailing list