(Neglected to CC haskell-cafe, sorry Mario for the duplicate.)
The only plain-HTML solutions I’m aware of are the ‘title’
attribute and the HTML5 ‘<details>’ element. The latter may
contain a ‘<summary>’ element for the content displayed by
default, plus other content that the user can expand or collapse.
Unfortunately, as far as I know Lynx doesn’t support either of these;
not sure about other text browsers. In Lynx you could maybe get some
nice UX for this with the ‘<fn>’ footnote element from HTML 3.0,
but that’s deprecated and probably not supported in other browsers.
It
doesn’t help with Lynx support, but I guess the right thing to do here
for screenreader support in other browsers is to add the ‘tooltip’ role
to the tooltip element, toggle its ‘hidden’ attribute with JavaScript
to show and hide it, and use ‘aria-describedby’ / ‘aria-expanded’ on the
anchor element to handle relating the two and announcing the tooltip
correctly when it’s shown.