Javascript.html:10 Uncaught TypeError: Cannot set properties of null (setting 'innerHTML')

While working with the getElementById I encountered this null error in innerHTML

This is my code -----------


Line 8, the spelling of ‘output’ is incorrect.


<p id ="output"> Default Text </p>

The error has mentioned ‘null’ because it thinks there is no ID with the string ‘output’ present in the program. And therefore returned as either undefined while printing, or null while handling the error.

Oh my. That was quite silly of me, my bad! Thanks a lot though