Why DOM is not working in my Project?

The problem is when I use this code document.getElementById(“heading”).innerHtml=“Hi”;
In console tab , the heading changed. But when I use it inside my index.js file of my project , It is not working.

you are using wrong syntax .
correct syntax is
document.getElementById('your id ').innerHTML = your thing here ;

in your code

your Html should be HTML whole thing in capital

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.