I’m learning how to appending DOM nodes with Javascript and have a little clarification question. Here’s an example:
<html>
<head>
</head>
<body>
</body>
</html>
document.childNodes[0]
So here, you would get the <head> node because it is the first child after the <html> tag. My question is can I always consider “document” to be the equivalent of the <html> tag or root node?
I’d recommend studying the W3C DOM spec as well: even if some parts of it won’t mean much to you, it might save you a plenty of time and efforts later. )
That’s what’s said about
documenthere: