JSFiddle - React, Tailwind, and code Playground

HTML

<div class="content1">Test 1</div>
<button type="button" class="button1">Button</button>

JavaScript

"use strict";
	
	// Change content
	$(".button1").click(function() {
		$(".content1").html("Test 2");
	});
	
	// Check if content has changed
	var target = document.querySelector(".content1");
	var observer = new MutationObserver(function(mutations) {
		alert("Changed");
	});
	var config = { attributes: true, childList: true, characterData: true };
	observer.observe(target, config);