Issue on Checking Check box State On click (Checked or Un Checked)
I am using a Bootstrap Switch component instead of core html check box and I am having issue on getting the state of the check box on click. Can you please take a look at This Demo and let me know how I can enable my code to get the state of the checkbox change and alert in different states?
- $(document).ready(function () {
- $("[data-toggle='switch']").wrap('<div class="switch" />').parent().bootstrapSwitch();
- $('#test').click(function () {
- if ($('#chkSelect').attr('checked')) {
- alert("Is Checked");
- } else {
- alert("Is Un Checked");
- }
- });
- });
Thanks