这是我的代码
<asp:DropDownList id="lue1" runat="server">
<asp:ListItem Selected="True" Value=" - Select One - "> - Select One -
</asp:ListItem>
<asp:ListItem Value="Silver"> Silver </asp:ListItem>
<asp:ListItem Value="DarkGray"> Dark Gray</asp:ListItem>
<asp:ListItem Value="Khaki"> Khaki </asp:ListItem>
<asp:ListItem Value="DarkKhaki"> Dark Khaki </asp:ListItem>
</asp:DropDownList>
<br />
<a class="bullet blt-add" id="lnkAddAnother1" href="javascript:"
onclick="ShowNextCountrol(this,2)">Add Another</a>
功能ShowNextCountrol
会显示另一个dropdownlist
,selected listitem
将是第一个
答案 0 :(得分:0)
试试这个
document.getElementById("lue1").selectedIndex = 0;
答案 1 :(得分:0)
function setSelectedIndex(s, i)
{
s.options[i-1].selected = true;
return;
}
setSelectedIndex(document.getElementById("lue1"),2);
//在2的位置给出你需要的位置