Javascript set variable from within another function?
<p>Say I have a variable called "true" in a function called "test." Then I have another function in a whole different script tag and I want to change "true" using my new function. How can I do this? Thanks.</p>

<pre><code>&lt;script type="text/javascript"&gt;
var hello="no";
if(hello=="yes"){ 
  window.onbeforeunload = confirmExit;
  function confirmExit()
  {
    return "Message";
  }
}
&lt;/script&gt;

&lt;script type="text/javascript"&gt;
function show(id) {
     $('#' + id).show();
     var hello="yes";


}
&lt;/script&gt;
</code></pre>

<p>It doesnt seem to be working...</p>
