I know I can have one handler handle multiple events using jQuery like:
$('#myID').bind('blur mousedown mouseup focus', function (e) {}
Also, I can register an event from all elements using jQuery like:
$(document).on("click", "*", function(event) {
console.log("Click");
});
I have two questions:
How do I register a single listener for multiple events in pure javascript?
Is there any way to have a single handler for all events in a document using JS or jQuery, like a master handler which will delegate the events to my other handlers?
I am looking at something like this:
$(document).on("*", "*", function(event) {
console.log("I am the master handler...");
// call delegates
});