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

Home Forums JavaScript [Solved] Trouble Using Variable in GetElementById Reply To: [Solved] Trouble Using Variable in GetElementById

Alex Zaworski


I’m seeing this in the console when clicking one of the pins on your map:

Uncaught ReferenceError: loc is not defined

Which may be the error that’s preventing everything from working.

At any rate, passing a variable into getElementById is definitely valid, it’s kinda tough to guess what all’s going wrong. Do you have console logs before/after you can share?