Skip to content

Files

Latest commit

27aba81 · Apr 3, 2023

History

History
27 lines (19 loc) · 791 Bytes
·

nested-interactive-elements.md

File metadata and controls

27 lines (19 loc) · 791 Bytes
·

Nested Interactive Elements

Rule Details

Certain interactive controls such as button, summary, input, select, textarea, or a can't have interactive children. Nesting interactive elements produces invalid HTML, and assistive technologies, such as screen readers, might ignore or respond unexpectedly to such nested controls.

Resources

Examples

Incorrect code for this rule 👎

<!-- incorrect -->
<button>
  <a href='https://github.com/'>Go to GitHub</a>
</button>

Correct code for this rule 👍

<!-- correct -->
<button>Confirm</button>