Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery -- Action fires on any event [duplicate]

Is there something in jquery where a function is triggered when any event is fired?

I'd like something like this:

$("*").anyEvent(function(){
  $("#error").html("");
});
like image 517
Peter Olson Avatar asked Feb 25 '11 22:02

Peter Olson


1 Answers

$('*').on('blur change click dblclick error focus focusin focusout hover keydown keypress keyup load mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup resize scroll select submit', function(){
  $('#error').empty();
});

...but would you want to do this?

like image 193
Matt Ball Avatar answered Nov 15 '22 19:11

Matt Ball