Jquery Checkbox Checked

How to verify if the checkbox is checked using jquery

Based on Gabriel Romanato codepen snippet, we need can use add class and remove class by verifying with checked attribute.

<form id="guest" action="#" method="post">
    <div>
        <input type="checkbox" name="check" id="trbl"/>
    </div>
</form>

$('#trbl').change(function() {

    var $trbl = $(this),
        $div = $trbl.parent();

    if ($trbl.prop('checked')) {

        $div.addClass('guest');

    } else {

        $div.removeClass('guest');

    }

});
Author : gabrieleromanato
Developed : HTML, CSS, Js, JQuery

jQuery DataTables – Row selection using checkboxes

Author : gyrocode
Developed : HTML, CSS, Js, JQuery

Select All Checkbox with intermediate state

Author : revive
Developed : HTML, CSS, Js, JQuery

Checkbox Check/ Uncheck event Jquery

Author : Shabnam Khan
Developed : HTML, CSS, Js, JQuery

Check and Uncheck all checkboxes with jquery

Author : Araf Hossain
Developed : HTML, CSS, Js, JQuery

If the checkbox is checked, Simple jquery, Add javascript later

Author : Sachin
Developed : HTML, CSS, Js, JQuery

Select/Deselect all checkboxes using jquery

Author : Dhaval Thakkar
Developed : HTML, CSS, Js, JQuery

Jquery Validate: Custom CSS checkbox example

Author : Martin
Developed : HTML, CSS, Js, JQuery
Spread the love

Leave a Comment