function dowork() {
$("div#TestPart select option[value^=HMT]").addClass("wrappedElement");
}
protected void Page_Load(object sender, EventArgs e)
{
lstDepartment.Attributes.Add("onchange","return dowork();");
}
問題の内容がわかりません。あなたの助言のために私を助けて、事前に感謝してください。
*<div id="sidebar">
</div>
<div id="main">
<div id="header">
<asp:Label ID="lblPackageName" runat="server" Text="Package Name"></asp:Label>
<asp:TextBox ID="txtPackageName" runat="server"></asp:TextBox>
<asp:Label ID="Label1" runat="server" Text="Sex"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>--Select--</asp:ListItem>
<asp:ListItem>Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem>
<asp:ListItem>Both</asp:ListItem>
</asp:DropDownList>
</div>
<div id="DepPart">
<asp:ListBox ID="lstDepartment" runat="server"
onselectedindexchanged="lstDepartment_SelectedIndexChanged"
AutoPostBack="True"></asp:ListBox>
</div>
<div id="TestPart">
<asp:ListBox ID="lstTest" runat="server"
onselectedindexchanged="lstTest_SelectedIndexChanged" AutoPostBack="True"> </asp:ListBox>
</div>
<div id="SubTestPart">
<asp:ListBox ID="lstSubTest" runat="server"></asp:ListBox>
</div>
<div id="SelectedTestPart">
<asp:ListBox ID="lstSelectedTest" runat="server"></asp:ListBox>
</div>
</div>*
<script type="text/javascript" language="javascript">
function dowork()
{
$("div#TestPart select option[value^=HMT]").addClass("wrappedElement");
}
</script>
は、あなたのHTMLおよびJavaScript – gdoron