Home › Forums › JavaScript › Query: JS Variables › Re: Query: JS Variables
July 18, 2013 at 10:22 am
#143470
Participant
Okay, so I’ve opted for solution “3”. I felt that it would be tidier. So, I now have the following code at the top of my JS script:
var nav;
var button;
function updateVar() {
nav = document.getElementById(“navBar”);
button = document.getElementById(“navButton”);
}
And, I have added this to my HTML document:
Now it works.
Thanks! … :)