$('input:checkbox').change(function(){
    $(this)[this.checked?'attr':'removeAttr']('checked','checked')
  })

解决方案 »

  1.   

    不太明白你说的意思
    看看你是不是想要这种效果:<input type="checkbox" class="check" value="1">
    <input type="checkbox" class="check" value="2">
    <input type="checkbox" class="check" value="3">
    <input type="checkbox" class="check" value="4">$(".check").click(function(){
        var a=$(this).val();
        if(this.checked){
            alert("你选中了第"+a+"个")
        }else{
            
        }
    })