<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Title> and association selection-suitable for permission selection </title>
</Head>
<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 () = 'lil '){
Var input = li. childNodes [0]
If (input. tagName. toLowerCase () = 'input '){
Input. checked = this. checked
}
Li = li. parentElement. parentElement
}
}
</Script>
</Html>
Update: three-state cascade selection is supported.
Download:/Files/boolean/checkbox3StatucCascadeSelectTree.zip
Online demonstration:/Files/boolean/cascadeTree.htm