Compressed nested selection

Working example

The code

The HTML:

The JavaScript: