Reputation: 36620
Some questions regarding the DOM and what it exactly is.
When I access document
via console.dir
I get all the properties of document
like this:
When I do a console.log
I get something which looks more like the DOM:
console.log()
is the DOM. and the one from console.dir()
is the DOM and all the Javascript properties which exists on the DOM. Is this correct?console.log(window.document)
from a property of console.dir(window.document)
?Upvotes: 0
Views: 493
Reputation: 887415
The DOM (Document Object Model) is a generic term for a set of objects.
document
is a DOM object; you're just seeing two different ways of representing it.
You can access the DOM hierarchy via properties like .children
.
For more information, see the documentation.
Upvotes: 1