up
This commit is contained in:
parent
5ef1b92e8b
commit
d7d25f4d8b
36 changed files with 1239 additions and 25 deletions
|
@ -0,0 +1,68 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="tree"></div>
|
||||
|
||||
<!-- The result should be:
|
||||
<div id="tree">
|
||||
<ul>
|
||||
<li>Fish
|
||||
<ul>
|
||||
<li>trout</li>
|
||||
<li>salmon</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Trees
|
||||
<ul>
|
||||
<li>Huge
|
||||
<ul>
|
||||
<li>sequoia</li>
|
||||
<li>oak</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Flowering
|
||||
<ul>
|
||||
<li>redbud</li>
|
||||
<li>magnolia</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<script>
|
||||
let data = {
|
||||
"Fish": {
|
||||
"trout": {},
|
||||
"salmon": {}
|
||||
},
|
||||
|
||||
"Tree": {
|
||||
"Huge": {
|
||||
"sequoia": {},
|
||||
"oak": {}
|
||||
},
|
||||
"Flowering": {
|
||||
"redbud": {},
|
||||
"magnolia": {}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function createTree(container, data) {
|
||||
/* your code */
|
||||
}
|
||||
|
||||
createTree(document.getElementById('tree'), data);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue