If Igor's comment about reading `className` is correct then this could be done without getAttribute too?