JSFiddle - React, Tailwind, and code Playground
by cneeds
HTML
<div id="allEvents">
this is some text inside div allEvents
</div>
JavaScript
var arr = Object.keys(document).filter(function(x) {
return x.indexOf("on") == 0
}).map(function(x) {
return x.replace("on", "");
});
$('#allEvents').on(arr.join(" "), function(e) {
console.log(e.type);
});