<title>高手教程(study.p2hp.com)</title>
<title>高手教程(study.p2hp.com)</title>
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/2.1.2/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-treeview@1.4.2/jquery.treeview.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/jquery-treeview@1.4.2/jquery.treeview.min.css" rel="stylesheet">
<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
console.log("%s was toggled.", $(this).find(">span").text());
$("#add").click(function() {
var branches = $("<li><span class='folder'>New Sublist</span><ul>" +
"<li><span class='file'>Item1</span></li>" +
"<li><span class='file'>Item2</span></li></ul></li>").appendTo("#browser");
<h1 id="banner">jQuery Treeview 简单实例</h1>
<ul id="browser" class="filetree treeview-famfamfam">
<li><span class="folder">Folder 1</span>
<li><span class="folder">Item 1.1</span>
<li><span class="file">Item 1.1.1</span></li>
<li><span class="folder">Folder 2</span>
<li><span class="folder">Subfolder 2.1</span>
<li><span class="file">File 2.1.1</span></li>
<li><span class="file">File 2.1.2</span></li>
<li><span class="folder">Subfolder 2.2</span>
<li><span class="file">File 2.2.1</span></li>
<li><span class="file">File 2.2.2</span></li>
<li class="closed"><span class="folder">Folder 3 (closed at start)</span>
<li><span class="file">File 3.1</span></li>
<li><span class="file">File 4</span></li>
<button id="add">Add!</button>
<script type="text/javascript">
$(document).ready(function(){
console.log("%s was toggled.", $(this).find(">span").text());
$("#add").click(function() {
var branches = $("<li><span class='folder'>New Sublist</span><ul>" +
"<li><span class='file'>Item1</span></li>" +
"<li><span class='file'>Item2</span></li></ul></li>").appendTo("#browser");
<h1 id="banner">jQuery Treeview 简单实例</h1>
<ul id="browser" class="filetree treeview-famfamfam">
<li><span class="folder">Folder 1</span>
<li><span class="folder">Item 1.1</span>
<li><span class="file">Item 1.1.1</span></li>
<li><span class="folder">Folder 2</span>
<li><span class="folder">Subfolder 2.1</span>
<li><span class="file">File 2.1.1</span></li>
<li><span class="file">File 2.1.2</span></li>
<li><span class="folder">Subfolder 2.2</span>
<li><span class="file">File 2.2.1</span></li>
<li><span class="file">File 2.2.2</span></li>
<li class="closed"><span class="folder">Folder 3 (closed at start)</span>
<li><span class="file">File 3.1</span></li>
<li><span class="file">File 4</span></li>
<button id="add">Add!</button>