<details>, <dialog>, <progress>, <meter>, and more.
Interactive Elements
<details> and <summary>
Creates a native HTML collapsible accordion without JavaScript. The <summary> is the clickable title; the rest inside <details> is the hidden content.
The
open attribute makes the element start in an expanded state.<dialog>
Native HTML modal controlled via JavaScript with .showModal() and .close(). The open attribute displays it inline (without backdrop).
When opened with
.showModal(), it automatically creates a backdrop that can be styled via ::backdrop CSS pseudo-element.Form Elements
<datalist>
Adds autocomplete suggestions to an <input>. The user can still type freely — it’s not a required select.
Progress Indicators
<progress> and <meter>
- progress
- meter
Progress bar for a task. Use
value and max. Without value, it stays in an indeterminate state (animated).Semantic Text Tags
<abbr> - Abbreviations
<abbr> - Abbreviations
Abbreviation with tooltip on hover (via
title attribute).<time> - Date and Time
<time> - Date and Time
Machine-readable date/time via the
datetime attribute.<mark> - Highlighted Text
<mark> - Highlighted Text
Highlights text with yellow background (relevance/search results).
<kbd> - Keyboard Input
<kbd> - Keyboard Input
Represents a keyboard key.
<sub> / <sup> - Subscript and Superscript
<sub> / <sup> - Subscript and Superscript
Subscript and superscript text.
<del> / <ins> - Deletions and Insertions
<del> / <ins> - Deletions and Insertions
Semantically marked deleted (strikethrough) and inserted (underlined) text.
<figure> / <figcaption> - Figures with Captions
<figure> / <figcaption> - Figures with Captions
Wraps images, charts, or code blocks with a semantic caption.
Input Types Reference
Thetype attribute completely changes the behavior and appearance of inputs — validation, mobile keyboard, native browser UI.
- Text Inputs
- Numbers & Ranges
- Date & Time
- Other
Useful Input Attributes
| Attribute | Description |
|---|---|
required | Makes the field mandatory — form won’t submit without it filled. |
disabled | Disables the field — can’t be edited or submitted in form. |
readonly | Field is visible and submitted in form, but not editable by user. |
placeholder | Hint text displayed when field is empty. |
autofocus | Automatically focuses this field when page loads. |
pattern | Validates value with regular expression. E.g., pattern="[0-9]{5}" for ZIP code. |
maxlength / minlength | Limits max/min number of allowed characters. |
autocomplete | Controls browser autofill. E.g., "off", "email", "new-password". |