JSFiddle - React, Tailwind, and code Playground

by gyoshev

HTML

<div id="wrapper" style="display:none">
    <div id="inner">text</div>
</div>

JavaScript

var element = $("#wrapper"),
    bubbles = false;

if (WebKitMutationObserver) {
    var observer = new WebKitMutationObserver(function (mutations) {
      mutations.forEach(attrModified);
    });
    
    observer.observe(element[0], { attributes: true, subtree: bubbles });
    
    function attrModified(mutation) {
      var name = mutation.attributeName,
        newValue = mutation.target.getAttribute(name),
        oldValue = mutation.oldValue;
    
      console.log(name, mutation);
    }
} else {
    element.bind("DOMAttrModified", function(e) {
       console.log(e);
    });
}

setTimeout(function() {
    $("#wrapper")[0].style.cssText = "";
    $("#wrapper")[0].style.display = "block";
}, 3000);