Let’s go to console in write document.
We can see the whole html we wrote right ?
Let’s try to write
document.write('Hiiiiiiiii') in console and see the magic!
So where the document is coming from ?
document is a global object which is available on the browser. But it has a parent, can you guess ?
window in the console and see what happens –
Interested to make your self into a magician who can change the dom ?