console.clear(); function logEvent(evt) { // Uncomment to log a line every time an event is fired. //console.log(evt.target.id, evt.type, evt); } function showEvents(a){ console.log(a); a.addEventListener('beginEvent', logEvent); a.addEventListener('endEvent', logEvent); a.addEventListener('repeat', logEvent); } console.log(document.querySelectorAll('.animation')) Array.prototype.slice.call(document.querySelectorAll('.animation')).forEach(showEvents);