Javascript examples for DOM HTML Element:Body
Get Body Element using the document.body property.
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">set the background color of the document</button> <p id="demo"></p> <script> function myFunction() {//from w ww . j a va 2 s . c o m var x = document.body; x.style.backgroundColor = "#EEE"; } </script> </body> </html>