开发者

Jquery -- Action fires on any event [duplicate]

开发者 https://www.devze.com 2023-02-13 07:12 出处:网络
This question already has answers here: How can I bind all events on a DOM element? (7 answers) Closed 7 years ago.
This question already has answers here: How can I bind all events on a DOM element? (7 answers) Closed 7 years ago.

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("");
});


$('*').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?

0

精彩评论

暂无评论...
验证码 换一张
取 消