Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 5
    Unfortunately the documentation for UIEvent.initUIEvent() says Do not use this method anymore as it is deprecated. The createEvent docs say "Many methods used with createEvent, such as initCustomEvent, are deprecated. Use event constructors instead." This page looks promising for UI events. Commented Dec 3, 2015 at 5:27
  • 9
    True, but IE11 doesn't support the new Event() method. I think as a hack against older browsers you could do something like if (Event.prototype.initEvent) { /* deprecated method */ } else { /* current method */ }. Where the current method is the avetisk's answer. Commented Jan 19, 2016 at 23:31