title: click is not detecting the presence of the element
body: <p>Hi,</p>
  
  <p>I need javascript to click an html element but it doesnt appear in the dom right away so I have this code:</p>
  
  <pre><code>document.addEventListener("DOMContentLoaded", function(event) {
    // Select the node that will be observed for mutations
    var parentOfMyList = document.body;
  
    // Options for the observer (which mutations to observe)
    var config = {
      attributes: true,
      childList: true,
      subtree: true
    };
  
    // Callback function to execute when mutations are observed
    var callback = function(mutationsList) {
      for (var mutation of mutationsList) {
        if (mutation.type == 'childList') {
          var elt = document.getElementById("topcmm-123flashchat-main-toolbar-message-type-option");
          if (elt) {
              setTimeout(document.getElementById("topcmm-123flashchat-main-toolbar-message-type-option").click, 6000);
  
            observer.disconnect();
          }
        }
      }
    };
  
    // Create an observer instance linked to the callback function
    var observer = new MutationObserver(callback);
    observer.observe(parentOfMyList, config);
  });
  </code></pre>
  
  <p>but I get an error that says <code>'click' called on an object that does not implement interface HTMLElement</code>. Why is that? The element is supposed to be THERE by the time click() is executed (I am even giving it a 6 second head start to catch up). </p>
  
  <p>Thank you.</p>