Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Documents the htmx JavaScript API for imperative requests, DOM helpers, event listeners, config, and processing swapped markup.
91% 100%+9 ptsof test cases passed
Passed 23 of 23 test cases with the skill, and 21 of 23 without it.
3 of 3 safety checks passed
Not used yet
Use this skill when declarative attributes are not enough. Prefer attributes first; reach for the JavaScript API to integrate with third-party widgets, dynamically injected markup, instrumentation, or programmatic request flows.
Use htmx attributes when the behavior is visible in the HTML and tied to one element. Use the JS API when:
Set global config once before relying on htmx behavior. Common examples:
htmx-security.Keep config close to where htmx is loaded so there is one source of truth.
Use htmx DOM helpers for concise integration code:
| Need | Methods |
|---|---|
| Find one element | htmx.find, htmx.closest |
| Find many elements | htmx.findAll |
| Remove an element | htmx.remove |
| Add a class | htmx.addClass |
| Remove a class | htmx.removeClass |
| Toggle a class | htmx.toggleClass |
| Make one element selected | htmx.takeClass |
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.