Javascript error: Missing : after property id?
<p>Here's the code:</p>

<pre><code>window.onload({
    var Country = '&lt;?= $core-&gt;HotelData($hid, "country"); ?&gt;';
    var options = document.getElementsByTagName('option');
    for (var i = 0; i &lt; inputs.length; i ++) {
        if (options[i].type == 'option' &amp;&amp; options[i].value == Country) {
            options[i].attr('selected','selected');
        }
    }
});
</code></pre>

<p>I've been struggling with this for hours now, and figured it'd be better if I sought advice from experts.</p>

<p>UPDATE: Source</p>

<pre><code>window.onload({
    var Country = 'United Kingdom';
    var options = document.getElementsByTagName('option');
    for (var i = 0; i &lt; inputs.length; i ++) {
        if (options[i].type == 'option' &amp;&amp; options[i].value == Country) {
            options[i].attr('selected','selected');
        }
    }
});
</code></pre>

<p>UPDATE#2: Fix
The cause of the problem was mostly my stupidity.. ktnxbai</p>

<pre><code>function OnLoad() {
    var Country = "&lt;?= $core-&gt;HotelData($hid, "country"); ?&gt;";
    var options = document.getElementsByTagName('option');
    for (var i = 0; i &lt; options.length; i ++) {
        if (options[i].value == Country) {
            options[i].selected = true;
        }
    }
}

window.onload = OnLoad();
</code></pre>
