I am creating an event, so use the DOM Event constructor:
new Event(\'change\');
This works fine in modern browsers, however in Internet Ex
the custom-event
npm package worked beautifully for me
https://www.npmjs.com/package/custom-event
var CustomEvent = require('custom-event');
// add an appropriate event listener
target.addEventListener('cat', function(e) { process(e.detail) });
// create and dispatch the event
var event = new CustomEvent('cat', {
detail: {
hazcheeseburger: true
}
});
target.dispatchEvent(event);