日期:2014-05-17  浏览次数:20768 次

jquery怎么实现全选,全不选,删除功能
  现在的问题是,我做的全选功能,当单个选择时,全选的状态不变false,还有删除的不会做,求大神帮忙,谢谢。



<script type="text/javascript">

//全选/全不选
 $("#checkAll").click(function(){
      if(this.checked){
     $("input[name='pkId']").attr("checked","checked");
  }else{
     $("input[name='pkId']").attr("checked",null);
  }
   }); 
//反选
// $("#checkAll").click(function(){
//      $("input[name='pkId']").each(function(index,DomEle){
//     if(DomEle.checked){
//   $(DomEle).attr("checked",null);
//  }else{
//   $(DomEle).attr("checked","checked");
//  }
//   });



});








</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">

<jsp:include page="public/head.jsp"></jsp:include>

<table width="900" border="0" cellspacing="0" cellpadding="0" height="172" align="center" bgcolor="#FFFFFF" class="index_body">
  <tr>
    <td valign="top"> 
      <table width="882" border="0" cellspacing="0" cellpadding="0" height="11" align="center">
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
      <table width="882" border="0" cellspacing="0" cellpadding="0" align="center">
      </table>
      <s:form action ="/composite/myIssueAcction_findmyissueUIfoByCondition.action"
method="POST" id="findmyissueUIfoByCondition1">
<div align="center">
        <table width="882" border="0" cellspacing="0" cellpadding="0" height="47" background="${basePath }/global/images/portal/wdff.jpg">
          <tr> 
            <td width="538">&nbsp;</td>
            <td width="288" valign="bottom" align="right"> 
              <s:textfield id = "d1" name="productName" cssClass="input" size="32" value="%{paroductName}"/>
            </td>
            <td width="52"  valign="bottom" height="29">
            <img src="${basePath }/global/images/portal/search.png" id ="findmyissueUIfoByCondition2"  onclick="search()" style="cursor:pointer">
            </td>
          </tr>
        </table>
  &nb