js| Tree Type Structure
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> and Selection-for permission selection more appropriate </title>
<body>
<ul id= "Tree" >
<li><input type=checkbox>
<ul>
<li><input type=checkbox>
<ul>
<li><input type=checkbox></li>
<li><input type=checkbox></li>
</ul>
</li>
</ul>
</li>
</ul>
</body>
<script language= "JavaScript" >
var arr = tree.getelementsbytagname (' input ')
for (var i=0; i<arr.length; i++) {
var input = Arr[i]
if (input.type = ' checkbox ') {
Input.onclick = Clickinput
}
}
function Clickinput () {
var li = this.parentelement;
var arr = li.getelementsbytagname (' input ')
for (var i=0; i<arr.length; i++) {
var input = Arr[i]
if (Input.type = = ' checkbox ') {
input.checked = this.checked
}
}
var li = li.parentElement.parentElement
while (li.tagName.toLowerCase () = = ' Li ') {
var input = Li.childnodes[0]
if (input.tagName.toLowerCase () = = ' input ') {
input.checked = this.checked
}
Li = li.parentElement.parentElement
}
}
</script>