Hierarchical (tree) selector for Javascript