Another simple app that changes the background color of elements clicked on
By: Ajdin Imsirovic 24 November 2019
Image by CodingExercises
What we’ll be building
Here’s the code:
document.body.style.background = "yellow"
Obviously, running this code will change the background of the
body element of our page.
We can further improve this by getting the color as an input from the user, using the
var givenColor = prompt('Type in an HTML named color (such as orange, green, blue, etc.'); document.body.style.background = givenColor;