title: Simulate mouse click at x,y using javascript
body: <p>I am trying to simulate a mouse click at x,y co-ordinates using javascript.
  I am using the following functions which works fine for most of the html elements:</p>
  
  <pre><code>setTimeout(function() {
      var event = document.createEvent("MouseEvents");
      event.initEvent("click", true, true);
      document.elementFromPoint(x, y).dispatchEvent(event);
  }, 1000);
  </code></pre>
  
  <p>However,it is unable to select a text-box(input html control) when a co-ordinate contained within the text box is clicked.</p>
  
  <p>Is there anyway i can simulate selecting an input html element?</p>
  
  <p>Note:There is something on top of the webpage and i am kinda passing the click operation to the webpage below it using javascript.</p>