Dong
0
Q:

javascript style background color

 // change background color for specific id ..
function changebackground(){
	document.getElementById('id').style.backgroundColor = 'green' ; 
}
// change background color for whole body..
function changebackground(){
	document.body.style.backgroundColor = 'green';
}
 
12
document.body.style.backgroundColor = "yellow";
6
function changeBackground(color) {
   document.body.style.background = color;
}

window.addEventListener("load",function() { changeBackground('red') });
4
// Change the background color to red
document.body.style.backgroundColor = "red"; 
0

New to Communities?

Join the community