Skip to content Skip to sidebar Skip to footer

Event Fire On Every Checkbox

I have couple of images and next to it are checkbox, that doesn't display on its own, but if click on label fire the checkbox true or false, now I thought everything was fine, unti

Solution 1:

This apply to every input with type checkbox, and if you also keep this structure.

$('input:checkbox').on('change', function() {
    if ($(this).prop('checked') === true) {
        $(this).parent('div').siblings('.flex-column').children('h2.addMsg').fadeIn("fast").fadeOut(5000);
    } else {
        $(this).parent('div').siblings('.flex-column').children('h2.removeMsg').fadeIn("fast").fadeOut(5000);
    }
});

If you have any question, let me know.

EDIT :

Ofcourse you could replace input:checkbox, with the classname kdng.


Post a Comment for "Event Fire On Every Checkbox"