Change variable value using onchange
<p>I want to change the value of <code>value</code> using a <code>change</code> event listener. Is it possible? Here is my sample code:</p>

<pre><code>&lt;select name="select1" onchange="updatevariable(this.value)"&gt; 
    &lt;option value="2" &gt;2&lt;/option&gt;
&lt;option value="15" &gt;15&lt;/option&gt; 
&lt;/select&gt;
&lt;script type="text/javascript"&gt;
    value = "test";
    function updatevariable(data) { 
        value = data;       
    }
    alert(value); // It should be 2/15
&lt;/script&gt;
</code></pre>
