Pure JS infinite sub-select maker