Sometimes, we want to get the body element of site using only JavaScript.
In this article, we’ll look at how to get the body element of site using only JavaScript.
How to get the body element of site using only JavaScript?
To get the body element of site using only JavaScript, we use the document.body
property.
For instance, we write
document.body
to get the body element of the page.
Conclusion
To get the body element of site using only JavaScript, we use the document.body
property.