Trigger event by name

1

I get by a function the name of the event and the element that should trigger this event eg:

callEvent('click', 'btnEvent')

In this function I would like to return the element and trigger the last event

return:

var elem = document.getElementById('btnEvent');

there is something like

elemento.peformEvent('evento');

    
asked by anonymous 29.08.2017 / 21:54

0 answers