JavaScript JavaScript and the DOM Getting a Handle on the DOM Select a Page Element By Its ID

Zach Handler
Zach Handler
5,325 Points

Can't find the error in my code.

When I click the button the header does not change color.

I'm getting this error: Uncaught TypeError: Cannot read property 'addEventListener' of null

Here is my workspace: https://w.trhou.se/aj7xyt9tjn

1 Answer

You wrote 'my button' instead of "myButton" in the second line. You also wrote "stlye" instead of "style" in the event listener.