How to check a checkbox is checked or not using jQuery
<html>
<head>
<script type="text/javascript">
$(document).ready(function(){$('#checkdelivery').click(function(){
if($(this).prop("checked") == true)
{
alert("The checkbox is checked");
$('#addressbtn').show();
}
else if($(this).prop("checked") == false) {
alert("The checkbox is Unchecked");
$('#addressbtn').hide();
}
});
</script>
</head>
<body>
<input type="checkbox" id="checkdelivery" name = "checkdelivery"
value = "1"> Delivery address</input>
<input type="submit" id="addressbtn" name="addressbtn" value="Continue"
class="button"style="margin-left: 30px; width: 51% !important;display:none;"/>
</body>
</html>
Comments
Post a Comment