$('.p_check').click(function() {
if ($(this).is(':checked')) {
alert("checked");
} else {
alert("unchecked");
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class='checkbox p_check'><label><input type='checkbox'>New Password</label></div>
My alert is always "unchecked", no matter if I check or uncheck it
Aucun commentaire:
Enregistrer un commentaire