I am trying to do some checkbox manipulation with jquery. I have a modal popup and checkbox in it and I am using jquery to manipulate the checked mode. There is a variable which has either True or False, so if its True then check otherwise uncheck. But, in my case even when the value is False, the checkbox still stays checked. This is the code I am using:
$(document).on("click", ".open-EditCC", function () {
var life = $(this).data('life');
$('#<%=chkLife.ClientID%>').attr('checked', life);
$('#editCC').modal('show');
});
life variable gets either True or False but all the time the checkbox is checked, I set a breakpoint I can see that the value is False. Any idea what am I doing wrong? Thanks in advance, Laziale