Sometimes, we want to set style on body with JavaScript.
In this article, we’ll look at how to set style on body with JavaScript.
How to set style on body with JavaScript?
To set style on body with JavaScript, we set the style
properties.
For instance, we write
document.body.style.display = "block";
to set the display
property style to 'block'
on the body.
document.body
is the body element.
Conclusion
To set style on body with JavaScript, we set the style
properties.