JSFiddle - React, Tailwind, and code Playground
by dkunin
HTML
<script src="http://jquery.bassistance.de/treeview/jquery.treeview.js" type="text/javascript"></script>
<script type="text/javascript">
function toggltheme(what) {
$("#"+what).children().toggle();
};
function update(){
$("#tree").treeview()
}
children = 0
function addchild(where){
var Parent = document.getElementById("tree");
var NewLI = document.createElement("UL");
var before = document.getElementById(where);
NewLI.innerHTML = "<div onclick=\"toggltheme('"+children+"');\">></div><li id="+children+">this is a test #"+children+" <input type=\"button\" onclick=\"return addchild('"+children+"');\" value=\"+\"></li>";
before.appendChild(NewLI)
children++
update()
}
</script>
</head>
<body><input type="button" onclick="return addchild('tree');" value="+"></li>
<ul id="tree">
</ul>
<script>addchild('tree')
addchild('tree')
</script>