JSFiddle - React, Tailwind, and code Playground

by t2t2

HTML

<div id="parent"></div>
<div id="log"></div>

JavaScript

const parent = document.getElementById('parent');
const log = document.getElementById('log');

const obs = new MutationObserver(event => {
	log.innerText += '\n\n' + JSON.stringify(event);
});

const node = document.createElement('span');
obs.observe(node);
parent.appendChild(node);