fire-native-event
CommonJS module that fires a browser native event.
Should be compatible with IE6+ and reasonable browsers.
It doesn't perform any validation on the provided event object.
It really just fires it, using either Element.prototype.dispatchEvent
or Element.prototype.fireEvent
.
var createNativeEvent = require("create-event");
var eventType = "click";
var nativeEvent = createNativeEvent(eventType);
var element = document.createElement("div");
var fire = require("fire-native-event");
fire(element, nativeEvent, eventType);