简体   繁体   中英

How to get the Id of a particular control in UserControl in JQuery

I have a UserControl in asp.net page. The UserControl contains RadioButtonList control having 4 items. For each control in RadioButtonList, I have unique ID with it as follows.

rdlUser_0 - Leave
rdlUser_1 - Available
rdlUser_2 - Available at Home
rdlUser_3 - Available at Office

The following is the Markup for RadioButtonList

<asp:RadioButtonList ID="rdlUser" runat="server" ClientIDMode="Static">
            </asp:RadioButtonList>

How can I attach change event to rdlUser in jQuery?

确认讯息

$("[id^='rdlUser_'][type='radio']").change(function(){ //your code here });

这将绑定一个功能来更改所有单选按钮的事件

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM