Toggle effect on checkbox in jquery.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('#check').click(function() {
var $this = $(this);
// $this will contain a reference to the checkbox
if ($this.is(':checked')) {
alert("checked") ;
} else {
alert("not checked");
}
});
});
</script>
</head>
<body>
<input type="checkbox" name="checkbox" id ="check">
</body>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('#check').click(function() {
var $this = $(this);
// $this will contain a reference to the checkbox
if ($this.is(':checked')) {
alert("checked") ;
} else {
alert("not checked");
}
});
});
</script>
</head>
<body>
<input type="checkbox" name="checkbox" id ="check">
</body>
</html>