window.document color code example
Example 1: javascript change background color
document.body.style.backgroundColor = "yellow";
Example 2: JavaScript Change Background Color
var element = document.body;
element.style.backgroundColor = "blue";
document.body.style.backgroundColor = "yellow";
var element = document.body;
element.style.backgroundColor = "blue";