Can I find events bound on an element with jQuery?

前端 未结 9 1939
南旧
南旧 2020-11-22 07:11

I bind two event handlers on this link:

Show Alert

JavaScript:

$(         


        
9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 07:49

    When I pass a little complex DOM query to $._data like this: $._data($('#outerWrap .innerWrap ul li:last a'), 'events') it throws undefined in the browser console.

    So I had to use $._data on the parent div: $._data($('#outerWrap')[0], 'events') to see the events for the a tags. Here is a JSFiddle for the same: http://jsfiddle.net/giri_jeedigunta/MLcpT/4/

提交回复
热议问题