开发者

Jquery -- Action fires on any event [duplicate]

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜