JavaScript code not running
<p>I have the following code:</p>

<pre><code>...&lt;some code&gt;...
...&lt;elements load&gt;...

&lt;script type="text/javascript"&gt;

    var selected_city = document.getElementById('jform_city').value;
    var selected_province=document.getElementById('jform_province').value;

    &lt;!-- set the onchange property for all options in provice to activate getCities() --&gt;
    document.getElementById('jform_province').onchange = function() {
        getCities();
    }

    if(selected_province != ''){
        getCities();
    }
&lt;/script&gt;

...&lt;more elements load&gt;....

&lt;script type="text/javascript"&gt;
    alert("TEST");
    document.getElementById(selected_city).selected="1";
    &lt;/script&gt;
</code></pre>

<p>It selects an option from a drop down list I have, the problem is, if I remove the <strong>alert("")</strong> it stops working for some reason, any ideas?</p>
