function changeBackground(color) { document.body.style.background = color; } window.addEventListener("load",function() { changeBackground('red') });