if checkbox checked add class to parent element

Try this…

$(":checkbox").on('click', function(){
     $(this).parent().toggleClass("checked");
});

Example

Greetings.

Leave a Comment