That's not the solution. The solution is adding the correct attributes to the markup. Attributes that are universally recognized and already work with a11y tools.
In this example we'd add an aria-labelledby to the button which references the span with the correct info.
In this example we'd add an aria-labelledby to the button which references the span with the correct info.