Change label when checkbox is checked

后端 未结 3 1931
说谎
说谎 2021-01-28 23:47

I have a lot of listst with checkboxes like so:

3条回答
  •  感动是毒
    2021-01-29 00:29

    You are currently trying to call toggleClass on the input element, not the label. You can use parent to get the label:

    $(".filteritem").click(function(){
        $(this).parent().toggleClass('highlight');
    });
    

提交回复
热议问题