Wait what. This should not have worked. `elem` comes from below, in the loop. zomg, bug. This the parameter `v` should be renamed to `elem`.

Also, I did XPath because I don't think I can do that with CSS selectors.