Why are two click events registered in this html/css/jquery

前端 未结 9 1852
清歌不尽
清歌不尽 2020-12-20 17:25

I am trying to style a checkbox list. I\'ve added my styles and they appear correctly when rendered. I want to add a class when the label for the checkbox is clicked. This i

9条回答
  •  無奈伤痛
    2020-12-20 17:48

    You could also try:

    $('label[for^="test_"]').click(function(){
        $('div#target').append($(this).clone());
        return false;    
    });
    

提交回复
热议问题