Accordion level one
- first item
- second item
- third item
level one
- first item
- second item
- third item
level one
- first item
- second item
- third item
<script> <BR>var heads = document.querySelectorAll(".first-level"); <BR>function headClick(event){ <BR>var target = EventUtil.getTarget(event); <BR>toggleDisplay(toggget .parentNode.querySelector("ul")); <BR>} <BR>for(var i=0;i<heads.length;i ){ <BR>EventUtil.addHandler(heads[i], "click", headClick); <BR>} <BR><BR>window.onunload = function (){ <br>for(var i=0;i<heads.length;i ){ <br>EventUtil.removeHandler(heads[i ], "click", headClick); <BR>} <BR>heads = null; <BR>} <BR><BR> <BR>common.js檔案</script>