我有 2 个带有 OnSelectedIndexChanged 属性的 asp:DropdownLists。当它被触发时,我想运行一个 jquery 函数,让用户知道数据正在处理。我如何跳转到我的 jQuery 函数,有没有一种方法我不必使用唯一的 id?
<asp:DropDownList ID="ddlFirst" runat="server" OnSelectedIndexChanged="ddlChange">
<asp:ListItem>All</asp:ListItem>
<asp:ListItem>None</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="ddlSecond" runat="server" OnSelectedIndexChanged="ddlChange">
<asp:ListItem>All</asp:ListItem>
<asp:ListItem>None</asp:ListItem>
</asp:DropDownList>
$(document).ready(function () {
$("???").change(function () {
//code
});
});
最佳答案
给他们一个类并使用$('.yourClass')
关于javascript - 如何使用下拉列表触发 Jquery 函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5005135/