Opengist Logo Gist@portalZINE

Explore

  • All gists
  • Topics
  • Users
Data Privacy
Give feedback on the new UI Powered by Opengist ⋅ 41ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login
j

javascript

Recently created Least recently created Recently updated Least recently updated
portalzine

portalzine / HTMX - Process on DOM changes

Last active 3 months ago htmx javascript mutationobserver
0 0 1
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})