Javascript global resetting
<p>I am somewhat new to Javascript have read some into it and got the following problem: I created a global var, i'm setting it in a function and i'm trying to call it in another function but it comes out as undefined.
I've googled around and it seems it's called Javascript Hoisting Decleration. But i can't find the solution on this. This is my code.</p>

<pre><code>&lt;script type="text/javascript"&gt;
var value;
function getComboBox() {
    var value = document.getElementById('vereniging').value;
    console.log(value);
}
function isChanged() {
    console.log(value);
    var chboxs = document.getElementById('checkbox');
    var show = document.getElementById('hidden');
    if(chboxs.checked &amp;&amp; value=='BNI') {
    show2.style.display= 'block';
    show.style.display='none';
    }
    if(chboxs.checked &amp;&amp; value=='WTC') {    
    show2.style.display='none';
    show.style.display='block';
    }
} &lt;/script&gt;
</code></pre>

<p>it sets correctly with the first function.</p>