JavaScript JavaScript and the DOM Responding to User Interaction Adding an Event Listener

Error in changing the background color

Where am i wrong.

app.js
var warning = document.getElementById("warning");
var button= document.getElementById("makeItRed");
button.addEventListener('click' ,() => { warning.style.backgroundcolor="red" });
index.html
<!DOCTYPE html>
<html>
    <head>
        <title>Adding an Event Listener</title>
    </head>
    <link rel="stylesheet" href="style.css" />
    <body>
        <div id="warning">
            Warning: My background should be red!
        </div>
        <button id="makeItRed">Make It Red!</button>
        <script src="app.js"></script>
    </body>
</html>
Sheila Anguiano
Sheila Anguiano
24,762 Points

Hi,

The problem is a typo in the property name, you have style.backgroundcolor and it should be style.backgroundColor