Here’s an interesting DOM test-case I ran across inadvertently yesterday.
For the purpose of this post assume the following markup:
If I use
document.documentElement.firstChild I don’t get consistent behavior. In Firefox and IE I get the
<head/> element, which is what I was initially expecting. In WebKit (Safari/Chrome) and Opera. I get the HTML comment which I wasn’t.