jquery 一个checkbox全选与反选(找了很久,终于找到了)

来源:互联网 发布:软件项目管理注意事项 编辑:程序博客网 时间:2024/05/21 17:32

先上图:


      图1


             图2


<!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><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><script src="jquery-1.3.2.min.js" type="text/javascript"></script><script src="webdatagrid.js" type="text/javascript"></script><title>无标题文档</title></head><script type="text/javascript"> $(document).ready(function(){  $.select("selectall","items");});</script><body><input type="checkbox" name="selectall" id="selectall" />你试试<br /><input type="checkbox" value="1" name="items" />1<input type="checkbox" value="2" name="items" />2<input type="checkbox" value="3" name="items" />3<input type="checkbox" value="4" name="items" />4<input type="checkbox" value="5" name="items" />5<input type="checkbox" value="6" name="items" />6</body></html>

webdatagrid.js 下载地址:点击打开链接

原创粉丝点击