且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何记录一个元素在jQuery中触发的所有事件?

更新时间:2023-10-30 15:06:10

$(element).on("click mousedown mouseup focus blur keydown change",function(e){
     console.log(e);
});

这将为您提供很多(但不是全部)关于事件触发的信息。 ..除了手动编码这样,我不能想到任何其他方式来做到这一点。

That will get you a lot (but not all) of the information on if an event is fired... other than manually coding it like this, I can't think of any other way to do that.