how to change background color in javascript w3schools
// 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';
}
var element = document.body;
element.style.backgroundColor = "blue";function changeBackground(color) {
document.body.style.background = color;
}
window.addEventListener("load",function() { changeBackground('red') });var warning = document.getElementById("warning");
warning.style.background-color = "red";
Also in JavaScript:
- javascript array push object
- key value json javascript
- javascript get all elements of an id
- express router file
- react post request
- https.get module in nodejs
- short string javascript
- node list files in directory
- javascript execute function by string name
- dynamodb pagination nodejs
- scroll to top
- how to remove key value pair from object js
- string concat javascript
- javascript find prime number
- variable defaults javascript es6
- Ocultar o mostrar elementos HTML con JQuery
- resize js
- ad data to js object
- set time slots with date in javascript
- js remove last character
- js calculate date difference
- Math.random javascript double
- clear form inside modal after close reactjs
- react enzyme