Interactive Elements for HTMLs
Interactive elements in HTML provide behaviour without JavaScript. The details and summary pair makes a disclosure widget, dialog creates a modal or non-modal window, and buttons and links handle actions and navigation. Used with correct roles, focus order and ARIA only where needed, they keep a page keyboard and screen reader friendly.
Stage: Forms and Interaction · Part of the HTML roadmap · Last reviewed 19 November 2026
What to learn in Interactive Elements
- Build an expandable section with details and summary
- Open and close a dialog element with its JavaScript methods
- Choose between a button and an anchor for an action
- Make interactive controls reachable and visible with keyboard focus
- Add an ARIA label only when native semantics are not enough
Interactive Elements interview questions
When should you use a button and when a link?
Use an anchor with an href to go to another page or location, and a button to perform an action on the current page, such as submitting or opening a menu. Each has different keyboard behaviour and meaning for assistive technology.
What is the first rule of ARIA?
If a native HTML element already provides the semantics and behaviour you need, use it instead of adding ARIA roles to a generic element. Native elements bring keyboard support and accessibility mapping for free, and wrong ARIA can make things worse.
Where Interactive Elements fits in the HTML roadmap
Interactive Elements belongs to the Forms and Interaction stage (beginner level), which takes about 8 hours. Collect input.