+ 2
How would u change the color of a webpage using JavaScript
When you are creating a website and what it to change its background-color, if something evaluates to true or if an event happened, then, how would you do it.
4 odpowiedzi
+ 4
/*
if (statement)
ChangeBackgroundColour(Green);
*/
//This is the theoretical code.
if (1==1)
document.body.style.backgroundColor = "green";
//This is practical code.
+ 5
you can use JavaScript and the getElementById fonction and then you can apply an new color to the background.
+ 2
Thx
+ 1
Please uf my abswer is satisfying you, mark it as the best answer.