code: function trigger(element, type) {
  	  if (!element || !type) {
  	    return;
  	  } // Create and dispatch the event
  
  
  	  var event = new Event(type); // Dispatch the event
  
  	  element.dispatchEvent(event);
  	}
docs: Trigger event