JSFiddle - React, Tailwind, and code Playground

HTML

<a id="clicker">clickme</a>

JavaScript

(function($,window,undef){

/**
 * creates a Mock event to be used with fire event
 * @param Element target an element to set as the target of the event - not required
 *  @param string type the type of the event to be fired. Will not be used by IE - not required.
 *
 */
Event.Mock = function(target,type){
        var e = window.event;
        
        type = type || 'click';
        
        if (document.createEvent){
            e = document.createEvent('HTMLEvents');
            e.initEvent(
                type //event type
                , false //bubbles - set to false because the event should like normal fireEvent
                , true //cancelable
            );
        }
        
        e = new Event(e);
        
        e.target = target;
        
        return e;
}

})(document.id,window);
    
$('clicker').addEvent('click',function(e){console.log(e);});    
$('clicker').fireEvent('click',new Event.Mock($('clicker'),'mousedown'));