Trigger Event JavaScript
// Simple trigger event
document.querySelector(theElem).dispatchEvent(new Event('mouseover'))
Lively Leopard
// Simple trigger event
document.querySelector(theElem).dispatchEvent(new Event('mouseover'))
//Listen for the event
window.addEventListener("MyEventType", function(evt) {
alert(evt.detail);
}, false);
//Dispatch an event
var evt = new CustomEvent("MyEventType", {detail: "Any Object Here"});
window.dispatchEvent(evt);
document.getElementById('myElementID').click();
element.dispatchEvent(event);