HTML代码: <div id="xiao"> <ul> <li></li> </ul> </div> js代码: <script> $(function () { $('#xiao').children().eq(0).attr('id','tree'); // console.log($('#d').children().eq(0).attr('id')); $("#tree").treeview({ collapsed: true, animated: "medium", control: "#sidetreecontrol", persist: "location" }); }) </script>
评论(0)