js全选反选特效代码分享,当选中行后该行背景变色改变,漂亮实用的js全选反选特效,结合自己的需求来修改即可。
<!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" /> <meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren"> <meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。"> <title>js制作实用的全选反选特效_武鸣人</title> <style type="text/css"> <!-- *{ padding:0px; margin:0px; font-family:Verdana, Arial, Helvetica, sans-serif; } body{ font-size:12px; color:#333333; } ul{ list-style:none; } img{ border:0px; } a{ color:#333333; text-decoration:none; } a:hover{ color:#FF3300; text-decoration:none; } #container { width:700px; margin:0px auto; } #register_list { width:600px; border-bottom:3px solid #6CC; } #listbanner b{ padding-left:40px; } .info_list li { height:21px; line-height:21px; border-bottom:1px dashed #CCC; } .info_list li input{ margin-right:8px; } li.bg { background-color:#f7f7f7; } .info_list span{ width:100px; float:right; text-align:center; } --> </style> <script type="text/javascript"> <!-- function selectall(whosform){ for(var i=0;i<whosform.elements.length;i++){ var box = whosform.elements[i]; if (box.name != 'chkall') box.checked = whosform.chkall.checked; } }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) function switchall(whosform){ for(var i=0;i<whosform.elements.length;i++){ var box = whosform.elements[i]; if (box.name != 'chkall') box.checked = !box.checked; } var chkall = document.getElementById("chkall"); if (chkall.checked) chkall.checked = !chkall.checked; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) // --> </script> </head> <body> <a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr> <!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。--> <script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script> <script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script> <div id="container"> <div id="register_list"> <form method="post" name="listform" action=""> <ul class="info_list"> <li id="listbanner"><span>注册时间</span><span>联系人</span><span>所在地域</span><b>公司名称</b></li> <script type="text/javascript"> <!-- var a=1; for (var i=1;i<=7;i++){ if ( a%2 == 0){ document.write("<li><span>[2008-12-10]</span><span>李芮</span><span>江苏苏州</span><input type=\"checkbox\" name=\"list"+i+"\" id=\"checkbox\" /><a href=\"#\">苏州天颂</a></li>"); }else{ document.write("<li class=\"bg\"><span>[2008-12-10]</span><span>李芮</span><span>江苏苏州</span><input type='checkbox' name='list"+i+"' id='checkbox' /><a href=\"#\">苏州天颂</a></li>") } a=a+1; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) //--> </script> <!-- <li><span>[2008-12-10]</span><span>李芮</span><span>江苏苏州</span> <input type="checkbox" name="checkbox" id="checkbox" /> <a href="#">苏州天颂</a></li> --> <li id="listopera"> <input name="chkall" type="checkbox" id="chkall" value="" onclick="selectall(this.form)"/> 全选 <input name="swiall" type="button" id="swiall" value="反选" onclick="switchall(this.form)" /></li> </ul> </form> </div> <div id="Tobdy"> <div id="review_operation"> </div> <div id="register_info"></div> </div> </div> </body> </html>
本文来自武鸣人网站,转载请注明出处