Button

The element for actions on the page: submit a form, open a menu, close a dialog.

Domain
Languages
Type
Term
Source
General
Language
HTML

In plain English

Rule of thumb: if it goes somewhere, it's a link; if it does something, it's a button. Inside a form a button submits by default; add type="button" when it shouldn't.

Example

The menu toggle is a real button, so it works with the keyboard.

In code

<button type="button" aria-expanded="false" aria-controls="menu">Menu</button>

Related terms

Added 2026-11-30 · Last reviewed 2026-11-30