这个能实现全选啊。求解释。
$("input[name=items]").attr("checked","checked");
百度知道有点删问题。

解决方案 »

  1.   

    $("input[name=items]").attr("checked",false);
    看看
      

  2.   

    我测试了下,ie8下
    $("input[name=items]").attr("checked",null);
    也是可以的<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <script src="jquery-1.7.1.min.js"></script><head>
    <body>
     <input name=items type=checkbox>
     <input name=items type=checkbox>
     <input name=items type=checkbox>
     <input name=items type=checkbox>
    <input type="button" value="selectAll" onclick='$("input[name=items]").attr("checked","checked");'>
    <input type="button" value="UnSelectAll"  onclick='$("input[name=items]").attr("checked",null);'>
    <input type="button" value="UnSelectAll"  onclick='$("input[name=items]").attr("checked",false);'>
    </body>
    </html>
      

  3.   

    $("input[name=items]").removeAttr("checked");
      

  4.   

    我把jquery库换成了1.
    7就行了