Anne van Kesteren

nodeType 8 and getElementsByTagName

Late night MSN sessions…

  1. zcorpan <form> does not imply <body> in IE6
  2. anne interesting
  3. zcorpan it’s worse…
  4. zcorpan
    <!DOCTYPE html>
    <title>001</title>
    <style>
     div { position:relative; }
     form { width:40em; }
    </style>
    <div>
     <form>
      <p>test
     </form>
    </div>
  5. zcorpan innerHTML for that:
  6. zcorpan
    <HTML><HEAD><TITLE>001</TITLE>
    <STYLE>
     div { position:relative; }
     form { width:40em; }
    </STYLE>
    
    <FORM></HEAD>
    <BODY>
    <DIV>
    <P>test </FORM></P></DIV></BODY></HTML>
  7. anne ah, totally IE
  8. zcorpan the contents of the div are invisible
  9. anne hmm…
  10. anne o well
  11. anne debugging that sucks
  12. anne emulating it might be cool
  13. anne building IE again
  14. zcorpan the thought of it hurts my brains
  15. zcorpan javascript:alert(document.getElementsByTagName("!")[0].nodeValue)
  16. anne you’re so crazy
  17. zcorpan try that in a document that has a doctype declaration, with IE
  18. anne heh

Later on:

  1. zcorpan how can a node that is nodeType 8 be returned by getElementsByTagName?
  2. anne euh, good question

In reality, this post is about conversation markup. Although the various bits pointed out are quite interesting as well.