Welcome to the Treehouse Community
Looking to learn something new?
Lee Gentile1,707 Points
Issues inputing JS into the console / .getElementById
Whenever I try to change the color of the heading element in the console I keep getting this error message:
Uncaught TypeError: Cannot read property 'style' of null at <anonymous>:1:37
I literally typed exactly what he did:
document.getElementById('myHeading').style.color = 'red'
I'm using Chrome 56.0.2924.87
The command itself is correct. The error message suggests to me that it cannot find any element with an id of
myHeading in your webpage.
Can you post the HTML code from your index.html file? The error is likely somewhere within that file.