[car] Question about aria-label vs. aria-labelledby.
Say I have an element A that contains some nice label text, and an element B that I want to label with the text from element A.
Of course, they're both being generated in javascript, so the text is actually stored in a var elementAText
that I can put anywhere I want. :)
Is there any reason to use aria-labelledby over aria-label in this case?
Sometimes, aria-labelledby can be more work to use, because you have to create an id for element A, make sure it is unique, and then find a way through the crazy framework to set the id for element A onto element B.
When I could just say: elementB.setAttribute("aria-label", elementAText);
.