Anchor or button nested inside other anchor or button

Link to Anchor or button nested inside other anchor or button copied to clipboard

button-link-nested

Rule

Interactive control elements MUST NOT have focusable descendants.

Background

Invalid code - such as incorrectly nested elements - doesn't always cause accessibility problems, but it can, especially if there are errors in the parts of the markup that screen readers rely on to communicate the semantics of the web page to users. Focusable elements with an interactive control ancestor (any element that accepts user input such as button or anchor elements) are not announced by screen readers and create an empty tab stop.

How to Fix

Fix this issue by ensuring that button and link elements do not contain other button or link elements or any other interactive elements.