<script> //点击全选,子复选框被选中 function demo(){ var allcheck=document.getElementById("allcheck"); var choice=document.getElementsByName("choice"); for(var i=0;i<choice.length;i++){ choice[i].checked=allcheck.checked; } } //点击子复选框,全选框
<!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-Typ
1.方法1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>全选与反选</title> <meta http-equiv="Content-Type" content="te