Home › Forums › JavaScript › Query: JS Variables › Re: Query: JS Variables
July 18, 2013 at 9:12 am
#143476
Participant
The link I gave you at the top is using the first batch of code. That works perfectly well. But, the second batch of code there I can’t get to work in any browser.
Turns out it’s because the script was interpreted in the
element of the HTML document, before the other elements were loaded. This meant that it couldn’t “document.getElementById” because the element didn’t exist yet.