The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Query: JS Variables Re: Query: JS Variables


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.