Check if checkbox is NOT checked on click - jQuery

Solution 1:

Try this:

if(!$(this).is(':checked'))

demo

Solution 2:

The answer already posted will work. If you want to use the jQuery :not you can do this:

if ($(this).is(':not(:checked)'))

or

if ($(this).attr('checked') == false)

Solution 3:

jQuery to check for checked? Really?

if(!this.checked) {

Don't use a bazooka to do a razor's job.

Solution 4:

$(document).ready(function() {
        $("#check1").click(function() {
            var checked = $(this).is(':checked');
            if (checked) {
                alert('checked');
            } else {
                alert('unchecked');
            }
        });
    });