-1

In an HTML select element, is it possible to have the second option selected by default?

<select class="styled" onchange="location = this.options[this.selectedIndex].value;">
    <option value="9u.html">Team 9u</option>
    <option value="10u.html">Team 10u</option>
    <option value="11u.html">Team 11u</option>
    <option value="12u.html">Team 12u</option>
    <option value="13u.html">Team 13u</option>
    <option value="14u.html">Team 14u</option>
    <option value="15u.html">Team 15u</option>
    <option value="16u.html">Team 16u</option>
</select>

I would like the value "10u" to be in the select box when I load the page.

4

1 回答 1

2

使用选定的属性。谷歌倒闭了吗?

<option value="10u.html" selected>Team 10u</option>
于 2013-04-30T13:59:46.750 回答