“Cómo cambiar el color de fondo usando JS” Código de respuesta

color de fondo de estilo javascript

 // 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';
}
 
dr3am_warri0r

JavaScript Cambiar color de fondo

document.body.style.backgroundColor = "yellow";
Black Bat

JavaScript Cambiar color de fondo

function changeBackground(color) {
   document.body.style.background = color;
}

window.addEventListener("load",function() { changeBackground('red') });
Mobile Star

Cómo cambiar el color de fondo usando JS

var warning = document.getElementById("warning");
  warning.style.background-color = "red";

rabbit.sol

Respuestas similares a “Cómo cambiar el color de fondo usando JS”

Preguntas similares a “Cómo cambiar el color de fondo usando JS”

Más respuestas relacionadas con “Cómo cambiar el color de fondo usando JS” en JavaScript

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código