F.eks.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>Checke underliggende checkboxe</title>
<meta name="keywords" content="søgeord adskilt af komma">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
html,body{height:100%;margin:0px;border:0px;padding:0px;font-family:tahoma,verdana,arial,sans-serif;font-size:small;}
div{width:400px;border:1px dotted red;padding:3px;}
</style>
<script language="javascript" type="text/javascript">
function checkUnder(elm){
var inps = elm.parentNode.getElementsByTagName('INPUT');
for(i=0;inps.length>i;i++)
if(inps[i].type == 'checkbox')
inps[i].checked = true;
}
</script>
</head>
<body>
<form id="minForm" name="minForm">
<div>
<input type="checkbox" onclick="checkUnder(this);">Check alle under
<div>
<input type="checkbox" onclick="checkUnder(this);">Check alle under
<div>
<input type="checkbox">Check 1-1
<input type="checkbox">Check 1-2
<input type="checkbox">Check 1-3
</div>
</div>
<div>
<input type="checkbox" onclick="checkUnder(this);">Check alle under
<div>
<input type="checkbox" onclick="checkUnder(this);">Check alle under (2-1)
<div>
<input type="checkbox">Check 2-1-1
<input type="checkbox">Check 2-1-2
<input type="checkbox">Check 2-1-3
</div>
</div>
<input type="checkbox">Check 2-2
<input type="checkbox">Check 2-3
</div>
</div>
</form>
</body>
</html>