Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
450 views
in Technique[技术] by (71.8m points)

jquery - what events are bound?

Is there any way to see what events are bound to an element with jQuery?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you are using Safari or Chrome, you can open up the Developer Tools and inspect the element (by clicking the magnifying glass). In the Event Listeners tab on the right it will tell you the binded events to that element, with their functions and locations.

OR to do this via code:

$('selector').data('events'); // get
console.dir($('selector').data('events')); // display in firefox firebug or webkit's developer tools

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...