<tr bgcolor="#EAF6F6" style="border:1px red solid;">
<th align="right" class="cs">笔记:</th>
<td style="float:left;"><input name="afternote"  type="text" id="afternote" value="<?=$info['AFTERNOTE']?>"  style="float:left;"/></td><td style="float:left;"><input type="checkbox" value="" id="note_hide" >隐藏笔记
</td>
</tr>
<tr bgcolor="#EAF6F6">
<th align="right" class="cs">录像:</th>
<td style="float:left;"><input name="video"  type="text" id="video" value="<?=$info['VIDEO']?>" /></td><td style="float:left;"><input name="video_hide" id="video_hide"type="checkbox" value="">隐藏录像</td>
</tr>
  如何获取点击的状态和取消的状态   我用jquery写的!

解决方案 »

  1.   

    $("#video_hide").change(function(){});
      

  2.   

    $("#复选框的id").click(function(){
        if(this.checked == true){
    alert("选中");
        }else{
    alert("NO中");
        }
    });
      

  3.   


    $(':checkbox').click(function(){
        var _this = $(this);
        switch(_this.attr('id')){
            case 'video_hide':if($(':checked',_this)){
                                  //video_hide选中
                                }
                break;
            case 'note_hide':if($(':checked',_this)){
                                //note_hide选中
                           }
                break;
    }
        
    });
      

  4.   

    $(function(){
        $('#note_hide,#video_hide').click(function(){
            if($(this).is(":checked")){
                alert($(this).attr("id")+':选中')
            }else{
                alert($(this).attr("id")+':取消')
            }
        })
    })