How set item checkbox when i click on element span which have this checkbox?

前端 未结 3 1306
抹茶落季
抹茶落季 2021-01-21 05:11

Me need set item checkbox when i click on element span which have this checkbox.

Code:



        
3条回答
  •  悲&欢浪女
    2021-01-21 05:39

    $('.CheckMemberClassList').bind('click',function(){
        $('.CheckMemberClassList').removeClass('MemberClassActive').addClass('MemberClassInactive');
        $(this).removeClass('MemberClassInactive').addClass('MemberClassActive');
        $(this).find('input:radio').prop('checked', true);
    });
    

    Working Example: http://jsfiddle.net/hMYtg/

    Jquery .prop() Documentation: http://api.jquery.com/prop/

提交回复
热议问题