Skip to content

Instantly share code, notes, and snippets.

View ahmadina's full-sized avatar
🎯
Focusing

Ahmad ahmadina

🎯
Focusing
View GitHub Profile
@ahmadina
ahmadina / monitorEvents.js
Created October 19, 2016 08:02 — forked from PaulKinlan/monitorEvents.js
monitorEvents.js
function monitorEvents(element) {
var log = function(e) { console.log(e);};
var events = [];
for(var i in element) {
if(i.startsWith("on")) events.push(i.substr(2));
}
events.forEach(function(eventName) {
element.addEventListener(eventName, log);
});