| 1 | const observer = new MutationObserver((mutations) => { |
| 2 | mutations.forEach((mutation) => { |
| 3 | mutation.addedNodes.forEach((node) => { |
| 4 | if (node.nodeType === 1 && !node["htmx-internal-data"]) { |
| 5 | htmx.process(node) |
| 6 | } |
| 7 | }) |
| 8 | }) |
| 9 | }) |
| 10 | observer.observe(document, {childList: true, subtree: true}) |
| 11 |
portalzine / HTMX - Process on DOM changes
Last active 3 months ago
Revision 208ee0a1775b5e763f11896c4bb1b25403d7ec81