I have the following ASP.NET server control flags.
<asp:checkbox id="chkMonS1" runat="server" />
<asp:checkbox id="chkMonS2" runat="server" />
<asp:checkbox id="chkAllMon" runat="server" />
As well as other flags.
<asp:checkbox id="chkTueS1" runat="server" />
<asp:checkbox id="chkTueS2" runat="server" />
<asp:checkbox id="chkAllTue" runat="server" />
So, I tried using jQuery to select all the checkboxes, for example.
<script type="text/javascript">
$('chkAllMon').click(
function () {
$('chkMonS1').attr('checked', true)
$('chkMonS2').attr('checked', true)
}
)
</script>
However, this will not work. Where did this happen?
source
share