HTML to Pug Converter - Online Indented Template Syntax
Convert standard HTML into Pug (formerly Jade) syntax. Clean, indented output. For Node.js templating. Client‑side.
UD5 Toolkit
Explore the Invoker Commands API — a declarative way to wire up buttons to dialogs, popovers, and more without writing any JavaScript. Part of the modern HTML specification for building cleaner, more accessible UIs.
commandfor
No JavaScript needed — the button opens and closes the dialog declaratively.
<!-- Button triggers dialog via commandfor --> <button commandfor="demoDialog" command="show-modal"> Open Dialog </button> <button commandfor="demoDialog" command="close"> Close Dialog </button> <!-- The dialog itself --> <dialog id="demoDialog"> <h5>Dialog Opened!</h5> <p>No JavaScript needed.</p> <!-- Internal close button --> <button commandfor="demoDialog" command="close"> Close </button> </dialog>
<button id="myBtn">Open</button> <dialog id="myDialog">...</dialog> <script> document.getElementById('myBtn') .addEventListener('click', () => { document.getElementById('myDialog') .showModal(); }); </script>
<!-- No JavaScript needed! --> <button commandfor="myDialog" command="show-modal"> Open </button> <dialog id="myDialog">...</dialog>
| Browser | commandfor / command | Popover API | Notes |
|---|---|---|---|
| Chrome | ✅ 125+ | ✅ 114+ | Full support |
| Edge | ✅ 125+ | ✅ 114+ | Full support |
| Firefox | ⚠️ Partial | ✅ 125+ | commandfor behind flag; popover supported |
| Safari | ❌ Not yet | ⚠️ 17+ | Under development |
Last updated: Check Can I Use for the latest support data. Progressive enhancement recommended.
commandfor attribute?
commandfor is an HTML attribute placed on a <button> that references the id of a target element
(like a <dialog> or popover). Combined with the command attribute, it declaratively wires up
interactive behavior without JavaScript. It's part of the Invoker Commands API specification.
command attribute take?
Currently supported values: show-modal (opens a dialog modally), close (closes a dialog),
show-popover, hide-popover, and toggle-popover.
The value you use depends on the target element type and desired behavior.
No. That's the entire point! In supporting browsers, commandfor + command
work entirely through the browser's built-in HTML parser and rendering engine. Zero JavaScript is required.
For unsupported browsers, you can add a small polyfill or fallback.
commandfor keeps behavior in HTML where it belongs, making intent clearer and code more maintainable.
It works even when JavaScript is blocked or fails, improves accessibility by leveraging native browser mechanics,
and eliminates boilerplate event listener code.
A single commandfor attribute references one target ID. To control multiple elements,
you'd need multiple buttons. However, you can have multiple buttons all targeting the same element with different
command values (e.g., one for show, one for hide).
The popover attribute is placed on the target element to designate it as a popover.
commandfor is placed on the triggering button to reference and control that popover.
They work together: popover makes an element a popover; commandfor controls it declaratively.
Currently, commandfor is primarily designed for <dialog> and popover elements.
The Invoker Commands API may expand to support custom elements and other interactive targets in future
specification updates. For forms, traditional form attributes are still recommended.
Use progressive enhancement: keep your commandfor buttons, and add a small feature-detection script
that checks 'commandFor' in HTMLButtonElement.prototype. If unsupported, attach traditional
addEventListener handlers as a fallback. This ensures all users get a working experience.
Convert standard HTML into Pug (formerly Jade) syntax. Clean, indented output. For Node.js templating. Client‑side.
Configure how your PWA launches: focus existing or create new. Test with the launch_handler manifest field.
Build a horizontal scroll‑snap container with configurable snap‑type and alignment. Perfect for image galleries.
Compare all CSS easing presets side by side on a bouncing ball. See which curve fits your UI animation.
Query the permission state of camera, microphone, geolocation, and more. See the response and learn the API.
Process audio faster than real‑time with OfflineAudioContext. Apply filters and export the result. Dev tool.
Paste regular HTML and instantly get valid React JSX with proper self‑closing tags and className attributes.
Scroll a container and see how sticky elements behave. Adjust top, bottom, and scroll margins. Copy the code.
Test the experimental Translation API to translate text between languages directly in the browser, without cloud calls. Check support and copy the JavaScript starter.
Toggle scrollbar‑gutter: stable to reserve space for the scrollbar and avoid content jumps. Visual demo with two columns.
Acquire and release locks across tabs. Prevent race conditions in IndexedDB or localStorage. Visual queue and lock state.
Register a periodic background sync to fetch fresh data even when the tab is closed. Understand the API and limits.
Test the Fullscreen API: request fullscreen on a colored div, detect changes, and copy the JavaScript boilerplate.
Test the new HTML popover attribute for creating accessible tooltips, menus, and dialogs without JavaScript. Copy code snippets.
See the View Transitions API in action. Cross‑fade and morph between two states. Copy the JavaScript starter code.
Build a complex mailto: link with to, cc, bcc, subject, and body. Get the HTML anchor tag. Local.
Paste HTML and instantly remove all tags, leaving only the text content. Optional keep line breaks. Quick cleaning.
Type raw HTML and see the escaped version, then see how it renders when unescaped. Understand encoding better.
Create a customizable scrolling marquee banner. Copy the HTML and CSS. For retro web projects or fun.
Paste CSV and get a beautiful HTML table with sortable headers (optional). Copy the full HTML/CSS snippet. Local.
Write or paste an HTML snippet and generate a PDF using the browser's print engine. Customize page size and margins.
Paste an HTML `<table>` snippet and instantly get a clean Markdown table. Supports colspan and alignment hints. Local.
Paste lines of text and automatically convert to an HTML ordered list with correct numbering and indentation.
Reduce your HTML file size by stripping whitespace, comments, and optional closing tags. Secure browser‑based.
Paste multiple HTML snippets (header, footer) and a main content, then combine them into a single preview. Static site helper.
Find safe mixing ratios for the classic elephant toothpaste demonstration. Volume adjustments for different container sizes.
Strip HTML tags and convert web content to plain Markdown. Preserve headings, lists, and links. Perfect for content migration. All processing in browser.
Write or paste HTML, CSS, and JavaScript and instantly see the rendered output in a sandboxed iframe. A handy frontend prototyping tool.
Write Markdown and see the formatted HTML preview in real time. Syntax highlighting and GitHub-flavored Markdown support. No upload, fully local.
Tidy up messy HTML code with our online formatter and beautifier. Indent and clean your markup, preview the output instantly. No data is uploaded, everything runs in your browser.