I am new to JS. I actually thought I could edit html pages from external js files. It works when i put my codes in functions. But outside that, i get this error.
Uncaught TypeError: Cannot set property 'innerHTML' of null
Guys, am i missing something?
Here is my JS code.
var One = document.getElementById("one");
var script = "Your message has been received. One of our reps will contact your shortly";
One.innerHTML = script;