title: Javascript dispatchEvent click is not working in IE9 and IE10
body: <p>I'm trying to simulate mouse events like click, mouseover etc on app build in ExtJs. I'm using below code to simulate click,</p>
  
  <pre><code>function triggerEvent(element, eventName)
  {
      if (document.createEvent)
      {
          var evt = document.createEvent('MouseEvents');
          evt.initEvent(eventName, true, true);
  
          return element.dispatchEvent(evt);
      }
  }
  
  var btn = document.getElementById("loginButton");
  
  triggerEvent(btn, "click");
  </code></pre>
  
  <p>This works fine on chrome and firefox but never works on IE9 and IE10. If I use btn.fireEvent('onlclick') then it works fine in IE9 (not checked in IE10). document.createEvent is supported in IE9 &amp; IE10 but I'm not sure why my code is not working. </p>