Yeah I don't need to do that as I like to keep the text on the button. I'm wondering how best to associate each button with the code snippet.
Yeah I don't need to do that as I like to keep the text on the button. I'm wondering how best to associate each button with the code snippet.
check out the doc on aria-controls, i think that's the one you want
aria-controls has next to no support in the actual. Other strategies are recommended here.
she's already done one strategy by placing actual text in the button describing its function. the other commented thing here is aria-describedby but that's intended to be a more verbose version of aria-labeledby. neither of which tell of any action like aria-controls does
having low support doesn't make it wrong, it means those supposed to do the support are lacking. there's always a choice of how much and how far to go. between the added text and the aria-controls anything further is overkill and possibly enabling future lack of support by creating less demand
but it's a button and this is a descriptor, at some point we're literally arguing semantics... which is good but I've likely already gone farther than i should
I am commenting on it because this is a public context, and that folks less familiar with it may extrapolate on its functionality based on your comments, and then use it without testing.