<asp:CheckBox runat="server" ID="checkbox1" />
Whenever I check or uncheck my asp checkbox, it needs to trigger an event in javascript but it seems like the .click function is not triggered. Is the .click event wrong?
$(document).ready(function () {
$("#checkbox1").click(function (e) {
if (this.checked) {
//do something
}
else {
}
});
});
checkbox1will not work, you have to give the element some class and in javascript use that class selector.