How can I set the default value for a dropdown selection
<p>I assumed that the my select state dropdown box would automatically display "select state" However, this did not work as I had expected. The dropdown box is empty until I choose a country and only then will the state dropdown box display "select state. How can I set my state dropdown box to "select state" by default?</p>

<pre><code>function populateStates(countryElementId, stateElementId) {
var selectedCountryIndex = document.getElementById(countryElementId).selectedIndex;
var stateElement = document.getElementById(stateElementId);

stateElement.length = 0; //  
stateElement.options[0] = new Option('Select State', '');
stateElement.selectedIndex = 0;

var state_arr = s_a[selectedCountryIndex].split("|");

for (var i = 0; i &lt; state_arr.length; i++) {
    if (state_arr[i] != "") {
        stateElement.options[stateElement.length] = new Option(state_arr[i], state_arr[i]);
    }
  }
}

function populateCountries(countryElementId, stateElementId) {
// given the id of the &lt;select&gt; tag as function argument, it inserts &lt;option&gt; tags
var countryElement = document.getElementById(countryElementId);
jQuery("#" + countryElementId + " option").remove();
jQuery("#" + countryElementId).append("&lt;option value=\"\"&gt;USA&lt;/option&gt;");
for (var i = 0; i &lt; country_arr.length; i++) {
    countryElement.options[countryElement.length] = new Option(country_arr[i], country_arr[i]);
}

// Assigned all countries. Now assign event listener for the states.
if (stateElementId) {
    countryElement.onchange = function() {
        populateStates(countryElementId, stateElementId);
        jQuery("#" + stateElementId + " option:eq(0)").attr("selected", "selected");
        jQuery("#" + stateElementId).val("").change();
        if (jQuery("#" + countryElementId).val() == "USA") {
            jQuery("#Zip_Postal_Code__c").attr("maxlength", "5");
        } else if (jQuery("#" + countryElementId).val() == "Canada") {
            jQuery("#Zip_Postal_Code__c").attr("maxlength", "6");
        } else {
            jQuery("#Zip_Postal_Code__c").removeAttr("maxlength");
        }
    };
}
</code></pre>

<p>}</p>