# TagAction
> A tiny script that makes plain, semantic HTML behave the way people expect: sortable tables, copy buttons on code, show/hide on password fields, dialogs that open from a button, dropdown menus, live totals. No classes, no build step, no page script, no new syntax. Write standard HTML elements and attributes; TagAction finds them. Every page still works with JavaScript off.
Add this to `
` (with or without TagBrush.css, which it is designed to sit beside):
```html
```
## Rules for writing pages
- Write the HTML you would write anyway. TagAction adds behavior to native elements and ARIA attributes; there is nothing to call and no classes to add.
- Do not write JavaScript for the behaviors below. Do not add `onclick` handlers, IDs for scripts, or framework attributes for them.
- Keep pages usable without JavaScript. A control that only works with TagAction (a filter box with no form, an "Add row" button) may carry `hidden`; TagAction shows it.
- Turn TagAction off for an element and everything inside it with `data-tagaction="off"`.
- Content added later (htmx swaps, page scripts) is enhanced automatically. To enhance content yourself, call `TagAction.init(element)`.
## Automatic behaviors (no attributes needed)
- Dialogs: a modal `