JSFiddle - React, Tailwind, and code Playground

by Darko

HTML

<div class="elementor-menu-cart__container elementor-lightbox" aria-hidden="false">
  <p>
    test content
  </p>
</div>

JavaScript

// select the target node
var target = document.querySelector('.elementor-menu-cart__container');

// create an observer instance
var observer = new MutationObserver(function(mutations) {
  mutations.forEach(function(mutation) {
    console.log(mutation);
  });
});

// configuration of the observer:
var config = {
  attributes: true,
  childList: true,
  characterData: true
};

// pass in the target node, as well as the observer options
observer.observe( target, config);