HTML define what selection option is active

To preselect a value, just add the selected attribute to the desired option.

<select id="viewSelector" name="when" style="width:92%;">
    <option value="USA">USA</option>
    <option value="Australia" selected="selected">Australia</option>
    <option value="Germany">Germany</option>
</select>

This will preselect Australia for example.


You need to add a selected attribute to the option you want to select, as described in the spec.

<select id="viewSelector" name="when"">
    <option value="USA">USA</option>
    <option value="Australia" selected="selected">Australia</option>
    <option value="Germany">Germany</option>
</select>

In your script, you need to emit this attribute for whatever default you want to display.