<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>
</title>
</head>
<body>
<form action="">
<p><input type="checkbox" >我是谁</p>
<p><input type="checkbox" >我在哪</p>
<p><input type="checkbox" >我在做什么呢</p>
<p><input type="checkbox" >你知道</p>
<p><input type="checkbox" >我不知道</p>
</form>
<p>
<button id="all">全选</button>
<button id="notall">全不选</button>
<button id="unall">反选</button>
</p>
<script>
var all =document.getElementById('all');
var notall=document.getElementById('notall');
var unall=document.getElementById('unall');
var inputs =document.getElementsByTagName('input');
all.onclick=function(){
for(var i=0;i<inputs.length;i++){
inputs[i].checked=true;
}
}
notall.onclick=function(){
for(var i=0;i<inputs.length;i++){
inputs[i].checked=false;
}
}
unall.onclick=function(){
for(var i=0;i<inputs.length;i++){
inputs[i].checked = !inputs[i].checked;
}
}
</script>

</body>
</html>

最新文章

  1. Ubuntu 部署 Node.js 应用
  2. mysql延迟查询, 覆盖索引使用例子
  3. C#中使用System.Web.Mail.MailMessage类无法CC多人的问题
  4. 使用ASP.Net WebAPI构建REST服务(一)——简单的示例
  5. 四个查找命令find,locate,whereis,which的区别
  6. Oracle逻辑读详解
  7. 由12306出错想到的div垂直居中的问题
  8. arcgis for android访问arcgis server上自己制作部署的地图服务
  9. android应用程序的优先级
  10. python np.linspace
  11. 授权(Authorization)
  12. C# 窗体靠近屏幕边缘自动隐藏*学习(类似于QQ)
  13. web开发 关于src跳转
  14. git常用命令&lt;转&gt;
  15. Visual Studio 继续并运行上次的成功生成,未提示直接运行上一个版本解决方案!
  16. 【原】vue单文件组件互相通讯
  17. java Properties类得到当前的系统属性
  18. 如何用Python在豆瓣中获取自己喜欢的TOP N电影信息
  19. (一)JUnit简介
  20. 11-Cookie&amp;Session

热门文章

  1. 网络project1101班2014-2015学年《网络软件开发实训》期末考试
  2. 【HDU 5402】Travelling Salesman Problem(构造)
  3. Function的一些结论与eval函数.
  4. Linux 终端仿真程序Putty
  5. 利用Python网络爬虫抓取微信好友的签名及其可视化展示
  6. linux下,yum 安装mysql
  7. CSUOJ 1651 Weirdo
  8. P2186 小Z的栈函数
  9. [Python] Find available methods and help in REPL
  10. Fastboot线刷“复活”之刷机心得(三)——错误处理