I'm a beginner. The idea of the whole thing is when a user clicks on a button, it prompts the user to insert a color name. Once inserted, the background should become the color the user chose.
Here's what I could come up with:
function changeColor() {
let newColor = prompt("What color do you want?", "");
document.getElementsByClassName("container").style.backGroundColor = `${newColor}`;
}
It doesn't work this way, but I have a feeling I'm somewhere close. Would appreciate some advice :)