code: function isDetached(container, target) {
      const docElement = document.documentElement;
  
      return (
          container !== docElement && !docElement.contains(container) ||
          !container.contains(target)
      );
  }
docs: Tells whether target is a descendant of container element
  and that both of them are present in DOM.
  
  @param {Element} container - Container element.
  @param {Element} target - Target element.
  @returns {Boolean}