Is there some way we could figure things out without calling isElementInDropdown? It seems little bit nasty that we control HTML and the whole output - but then we need to analyze the structure to figure out what decision we made previously in PHP.