Jeremy Keith takes us through his thought process regarding the choice of link or
button when planning accessible interactive disclosure elements.
button is generally a solid choice as it’s built for general interactivity and carries the expectation that when activated, something somewhere happens. However in some cases a link might be appropriate, for example when the trigger and target content are relatively far apart in the DOM and we feel the need move the user to the target / give it focus.
For a typical disclosure pattern where some content is shown/hidden by an adjacent trigger, a
button suits perfectly. The DOM elements are right next to each other and flow into each other so there’s no need to move or focus anything.