jsTree简单应用Demo

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title></title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.2.1/themes/default/style.min.css" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.2.1/jstree.min.js"></script>
</head>
<body>
    <div id="jstree_demo_div" style="font-size:10pt;">
        <!-- in this example the tree is populated from inline HTML -->
        <ul>
            <li>
                Root node 1
                <ul>
                    <li id="child_node_1" data-jstree='{"icon":"http://www.jstree.com/tree.png"}'>Child node 1</li>
                    <li data-jstree='{"icon":"http://www.jstree.com/tree.png"}'>Child node 2</li>
                </ul>
            </li>
            <li>Root node 2</li>
        </ul>
    </div>

   <script>
       $(function () { $('#jstree_demo_div').jstree(); });

   </script>
</body>
</html>

 源自:https://www.jstree.com/docs/html/

原文地址:https://www.cnblogs.com/xp1056/p/5647463.html