global variable not changed
<p>I declared two variables globally, first one is input text field and second is select field. When I change the option field, the local variable values set is to the global variables. But global variables didn't got the values.</p>

<pre><code>&lt;script type="text/javascript"&gt;
var id1;
var opt1;
$(document).ready(function() {
    $("#opt").change(function() {
        id = $("#id").val();
        opt = $("#opt").val();
        id1 = id;
        opt1 = opt;
        if(!id=="" &amp;&amp; !opt=="") {
            //alert(id);
        } else { }
     });
&lt;/script&gt;
</code></pre>
