[Solved] I want to add / remove class on lable tag [duplicate]


Change javascript as per below

$('.lable_item input[type="checkbox"]').click(function(){
        if(!$(this).is(':checked')){
           $(this).parent('.lable_item').addClass('label_act');
    }else{
           $(this).parent('.lable_item').removeClass('label_act');
    }
});

change HTML As per below. It’s working.

<div class="layout">
   <label class="lable_item" for="c1"><input type="checkbox" id="c1" />label</label>
   <label class="lable_item label_act" for="c2"><input type="checkbox" id="c2" />label</label>
   <label class="lable_item" for="c3"><input type="checkbox" id="c3" />label</label>
</div>

solved I want to add / remove class on lable tag [duplicate]