I've a check box inside a repeater control. the repeater may have variable number of items. I need to call a js function whenever a checkbox with id "DFO_MFO" of any list item is checked/unchecked. how can I do that? I've tried the following code but it is not working.
$(".DFO_MFO").change(function () {
DfoMfoChecked($(this));
})
ASP.Net Markup
<asp:CheckBox runat="server" id="DFO_MFO" class="DFO_MFO"></asp:CheckBox>
HTML Rendering
<span class="DFO_MFO">
<input id="ctl00_PageContent_BULK_WOTableControlRepeater_ctl00_DFO_MFO" type="checkbox" name="ctl00$PageContent$BULK_WOTableControlRepeater$ctl00$DFO_MFO">
</span>
DFO_MFOis the id of a control. 1). you cannot have multiple elements with same id 2). You have to use#for id selector and.for class selectorids generated are unique, like the HTML Rendering part shows. Also, why are you een bringing up the difference between#and.in selectors? The OP is targeting theclasscorrectly