title: JavaScript autoclick child node element
body: <p>I've been endlessly looking for a working way to automate a mouse click on a specific element using javascript (I'm making a user-script). The structure is like the below:</p>
  
  <pre><code>&lt;div id="elementContainer"&gt;
    &lt;div class="item1" style="width: 50px; height: 50px;"&gt;AutoClick Here!&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>item1</strong> is the thing I want to automate a click on. I've tried lots of approaches, e.g. getting the element and creating/initialising/dispatching a 'click' event on it, calling .click() on it etc, but to be honest I'm new to javascript and don't hugely know what I'm doing!</p>
  
  <p>I can happily get the element and make changes to it (like changing the innerHTML), but want to be able to simulate/automate a click on it too. I would be very grateful for any advice on how to proceed.</p>
  
  <p>Many thanks in advance!</p>