title: javascript simulate mouse click on specific position
body: <p>I need to now how to fire a mouse click event on a button automatically.
  I have this but doesn't work  :(  </p>
  
  <pre>window.setInterval(function() { simulateClick(); }, 2000);
  
  function simulateClick() {
      var evt = document.createEvent("MouseEvents");
      evt.initMouseEvent("click", false, false, window, 0, 684, 571, 684, 508, false, false, false, false, 0, null);
          var a;
      a.dispatchEvent(evt);
  }
  </pre>
  
  <p>Thanks in advance</p>
  
  <p>Oscar</p>