<div class="codetitle"> <span><a style="CURSOR: pointer" data="53855" class="copybut" id="copybut53855" onclick="doCopy('code53855')"><u>复代码</u></a></span> 代码如下:</div> <div class="codebody" id="code53855"> <br><SPAN style="FONT-SIZE: 14px">< ;!DOCTYPE html> <br><html> <br><머리> <br><title>复选框处理.html</title> <br><meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <br><meta http-equiv="description" content="내 페이지입니다"> <br><meta http-equiv="content-type" content="text/html; charset=UTF-8"> <br><!--<link rel="stylesheet" type="text/css" href="./styles.css">--> <br></head> <br><본문> <br><input type="checkbox" id="checkItem">전철/전불选 <br><br> <br><h3>爱好</h3> <br><input type="checkbox" name="item">看书 <br><br> <br><input type="checkbox" name="item">听Music乐 <br><br> <br><input type="checkbox" name="item">打球 <br><br> <br><input type="checkbox" name="item">散步 <br><br> <br><input type="checkbox" name="item">写代码 <br><br> <br><스크립트> <br>window.onload = function(){ <br>var checkItem = document.getElementById("checkItem").onclick = function(){ <br>var itemsElement = document.getElementsByName("item"); <br>for (var i = 0; i < itemsElement.length; i ) { <BR>var itemElement = itemsElement[i]; <BR>if (this.checked) { <BR>itemElement.checked = "체크됨"; <BR>} <BR>else { <BR>itemElement.checked = null; <BR>} <BR>} <BR>} <BR>} <BR></script> <br></body> <br></html> <br></SPAN> <br> </div>