javascript - How to get HTML element similar to getting BODY with document.body? -


I know there is a way to do this, but how can I not remember?

How can I go about grabbing the HTML element (top-most element DOM) using plain javascript?

Use document.documentElement .

View Docs:

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

javascript - What is an alternative to using getElementByClass for hiding multiple elements? -

c - Selecting a file randomly from a file system -