日期:2014-05-18 浏览次数:21181 次
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>无标题页</title> <script type="text/javascript"> function setList(){ var lists=document.getElementsByTagName("select"); for(var i=0;i<lists.length;i++){ lists[i].selectedIndex=1; } } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:DropDownList ID="DropDownList1" runat="server"> <asp:ListItem Value="1" Text="1" /> <asp:ListItem Value="2" Text="2" /> <asp:ListItem Value="3" Text="3" /> <asp:ListItem Value="4" Text="4" /> </asp:DropDownList> <asp:DropDownList ID="DropDownList2" runat="server"> <asp:ListItem Value="1" Text="1" /> <asp:ListItem Value="2" Text="2" /> <asp:ListItem Value="3" Text="3" /> <asp:ListItem Value="4" Text="4" /> </asp:DropDownList> <asp:DropDownList ID="DropDownList3" runat="server"> <asp:ListItem Value="1" Text="1" /> <asp:ListItem Value="2" Text="2" /> <asp:ListItem Value="3" Text="3" /> <asp:ListItem Value="4" Text="4" /> </asp:DropDownList> <input id="Button1" type="button" value="button" onclick="setList()" /> </div> </form> </body> </html>