Nested selection

Working example

The code

The HTML:

The JavaScript: