Posts Tagged ‘dom’

Adventures With document.documentElement.firstChild

Here’s an interesting DOM test-case I ran across inadvertently yesterday. For the purpose of this post assume the following markup: < !DOCTYPE html> <html> <!– i broke the dom –> <head>     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>     <title>Testcase</title> </head> <body> <p>Something</p> </body> </html> If I use document.documentElement.firstChild I don’t get consistent behavior. In […]