I have this switcher (Checked):
<div class="switch try">
<label><input checked="" type="checkbox" class="checkit"><span class="lever switch-col-green"></span></label>
</div>
How to know if this one is checked or unchecked when a user click on it ?
Here what i tried:
$(document).on('click','.try',function(e){
if($(".checkit").is(':checked')) {
alert("checked");
} else {
alert("Not checked");
}
});
But i don't get it working !