Hello! How do I run a code within event listener
programatically?
Example:
document.getElementById("voltar").addEventListener('click', function() {
alert("teste");
}, true);
I want to execute alert
of addEventListener
. I tried to set a name in function()
, and call alerta_listener()
but it did not work.