I was just playing around in the console, and noticed that if I type:
body
it returns <body>...</body>
This is obviously the same as window.body
, which therefore also returned <body>...</body>
Then document.body
also returns <body>...</body>
as expected, as the body is part of the document
object, and as far as I was aware, not the window
object.
For this reason I expected window.body
to return undefined.
Then I checked window.head
which returned undefined
.
This is the result I expected to happen with window.body
Finally, document.head
returned <head>...</head>
as expected.
Can anyone explain where window.body
comes from? A search on google, and stackoverflow couldn't answer this one for me.