var evnt = document.createEvent('Event'); evnt.initEvent('mycustomevent', true, false); element.dispatchEvent(evnt);