en.javascript.info/2-ui/1-document/05-basic-dom-node-properties/2-tree-info/task.md
2018-10-07 22:03:05 +03:00

14 lines
290 B
Markdown

importance: 5
---
# Count descendants
There's a tree structured as nested `ul/li`.
Write the code that for each `<li>` shows:
1. What's the text inside it (without the subtree)
2. The number of nested `<li>` -- all descendants, including the deeply nested ones.
[demo src="solution"]