addEventListener
lets me add one listener to a target associated with some event type.
Can I somehow listen to all the events emitted by a target? Every time a specified object emits an event - any event - I want to log the type of the event.
addEventListener
lets me add one listener to a target associated with some event type.
Can I somehow listen to all the events emitted by a target? Every time a specified object emits an event - any event - I want to log the type of the event.
Using jQuery you could bind all the standard JavaScript events using:
$('#element').bind('blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error', function(event) {
console.log(event.type);
}