Thursday, 5 May 2016

MVC - jQuery - check if checkbox is checked (selected)

Watch this example on YouTube:

<input id="Checkbox1" type="checkbox" />

<script type="text/javascript">
    $('#Checkbox1').attr('checked', true);

    if ($('#Checkbox1').is(':checked')) {
        alert('checked!!!');
    }

</script>

No comments:

Post a Comment