<div class="htmlarea"> <textarea id="runcode96725"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>심플 트리</title> <style type="text/css"> * {margin:0px; padding:0px;} #categoryTree {margin:0px; padding:0px;} #categoryTree ul {display:none; margin:0px;margin-left:5px; padding:0px 0px 0px 15px;} #categoryTree span {cursor:pointer;} </style> <ul id="categoryTree"> <li> <span> </span>국무회의<ul> <li> <span> </span>도청<ul> <li> <span></span>안후이</li> <li> <span></span>허난성<ul> <li> <span></span>푸양시</li> <li> <span></span>지에수시</li> </ul> </li> <li> <span></span>허베이성</li> <li> <span></span>광둥성</li> </ul> </li> <li> <span></span>도청2과<ul> <li> </li>판빙빙2<li> <span></span>판빙빙4<ul> <li> </li>어떤 감독<li> </li>어떤 감독<li> </li>어떤 감독<li> </li>어떤 감독<li> </li>어떤 감독<li> </li>어떤 감독<li> </li>어떤 감독<li> </li>어떤 감독<li> </li>어떤 감독<li> </li>어떤 감독<li> </li>어떤 감독<li> </li>어떤 감독<li> </li>어떤 감독<li> </li>어떤 감독</ul> </li> <li> </li>판빙빙2<li> </li>판빙빙2</ul> </li> <li> </li>도청3과<li> </li>도청4과</ul> </li> <li> </li> <li> <span> </span>국무회의<ul> <li> <span> </span>도청<ul> <li> <span></span>안후이</li> <li> <span></span>허난성<ul> <li> <span></span>푸양시</li> <li> <span></span>지에수시</li> </ul> </li> <li> <span></span>허베이성</li> <li> <span></span>광둥성</li> </ul> </li> </ul> </li> <li> </li> </ul> </textarea> <br><input onclick="runEx('runcode96725')" type="button" value="运行代码"><input onclick="doCopy('runcode96725')" type="button" value="复制代码"> <input onclick="doSave(runcode96725)" type="button" value="保存代码"> <a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">[Ctrl A 모두 선택 참고: </a>외부 J를 도입해야 하는 경우 실행하려면 새로 고쳐야 합니다 </div>]<script type="text/javascript"> window.onload = function() { var cate = document.getElementById("categoryTree"); var bBs = cate.getElementsByTagName("span"); var len = bBs.length; if (len > 0) { for (var i=0; i < len;i++) { var oTag = bBs[i].parentNode.getElementsByTagName("ul")[0]; if (oTag) { bBs[i].style.background = "#666"; bBs[i].onclick = function() { var oTag = this.parentNode.getElementsByTagName("ul")[0]; if (!(oTag.open)) { oTag.style.display = "block"; oTag.open = true; } else { oTag.style.display = "none"; oTag.open = null; } } } } } else { throw new Error("html struct error!"); } } </script>