I'm using jQuery Treeview. Is there's a way to populate a children开发者_C百科 node in a specific parent on onclick event? Please give me some advise or simple sample code to do this.
You can access the node with Javascript by using
document.getElementById('theParent')
    .getElementsByTagName('firstHierarchyTag')[n]
    .getElementsByTagName('secondHierarchyTag')[n]
    ...
Yes, it is possible, give us the HTML code then we will be able to give a very specific example.
// attach the treeview to the main ul
$("#mytree").treeview();
// listen for an event on a specific node
$("#mytreebranch").click(function() {
    var children = "<li><span class='folder'>New Children</span>"+
                   "<ul><li><span class='file'>Sub-child 1</span></li>" + 
                   "<li><span class='file'>Sub-child 2</span></li>" +
                   "</ul></li>";
     children = $(children).appendTo("#mytree");
    // add the new elements to the treeview
    $("#mytree").treeview({
        add: children
    });
});
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论