<Head> <script> function selectAll (box1, box2) {var allBox = document. getElementsByName (box1); var id = document. getElementsByName (box2); for (var I = 0; I <id. length; I ++) {if (id [I]. checked! = AllBox [0]. checked) {id [I]. click ();}}} </script>
<PRE style = "BACKGROUND-COLOR: rgb (240,240,240); MARGIN: 4px 0px" class = html name = "code"> function selectAll (box1, box2) {var allBox = document. getElementsByName (box1); var id = document. getElementById (box2); for (var I = 0; I <id. length; I ++) {if (id [I]. checked! = AllBox. checked) {id [I]. click () ;}}</PRE> <BR> <PRE> </PRE> <P> <BR> </P> <P> getElementById () <SPAN style = "WHITE-SPACE: pre"> </SPAN> Returns a reference to the first object with the specified id. <BR> getElementsByName () <SPAN style = "WHITE-SPACE: pre"> </SPAN> Returns a set of objects with the specified name. <BR> </P>