当我单击具有此复选框的元素跨度时,我需要设置项目复选框。
代码:
<script>
$('.CheckMemberClassList').bind('click',function(){
$('.CheckMemberClassList').removeClass('MemberClassActive').addClass('MemberClassInactive');
$(this).removeClass('MemberClassInactive').addClass('MemberClassActive');
});
</script>
<span class="MemberClass1 MemberClassActive CheckMemberClassList">
<input type="radio" name="MemberClassList" id="MemberClassList1" value="1" checked="checked">
Text One
</span>
<span class="MemberClass2 MemberClassInactive CheckMemberClassList">
<input type="radio" name="MemberClassList" id="MemberClassList2" value="2">
Text Two
</span>
<span class="MemberClass3 MemberClassInactive CheckMemberClassList">
<input type="radio" name="MemberClassList" id="MemberClassList3" value="3">
Text Tree
</span>
请告诉我我需要如何在这段代码中制作它?