<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript" language="javascript"> function selectedAll(){ var checkBoxStatus = document.getElementById("QueryAll").checked; var inputObj = document.getElementsByTagName('input'); for(var i=0;i<inputObj.length;i++){ if(inputObj[i].type == "checkbox"){ inputObj[i].checked = checkBoxStatus; } } } </script> </head> <body> <input type="checkbox" name="checkboxmain" id="QueryAll" onclick="javascript: selectedAll()"/><BR/> <input type="checkbox" id="checkboxname" /> 中国<BR/> <input type="checkbox" id="checkboxname" /> 美国 </body> </html>
?