All the div elements are nested inside another div with the ID #main. The structure resembles a tree, with each div connected to its parent by a single line. These div elements are dynamically generated, and their IDs are created following a specific pattern. For instance, the ID of the first child node is formed by appending "1" to the parent node's ID, while the second child node's ID includes a "2."
The root div's ID is node
The first child node's ID is node1
The second child node's ID is node2
The first child of node1 has the ID node11
The second child of node1 is identified as node12
For node11, the first child is node111
And the second child is referred to as node112
...
...
...
Requirement: When any div element is clicked, all its descendant nodes down to the leaves should be removed.