set background style javascript code example
Example 1: JavaScript Change Background Color
var element = document.body;
element.style.backgroundColor = "blue";
Example 2: document.body.style.background
// Change the background color to red
document.body.style.backgroundColor = "red";