Find elements with click event

2019-02-16 14:32发布

问题:

How can each element with a click event found by jQuery (2.2.1)?

This seems to not work anymore:

console.log($._data( $(this)[0], 'events' ))

回答1:

Try

$.each($("*"), function(index, value) {
    if ($._data($(value)[0], "events") != undefined) {
         console.log($._data($(value)[0], "events")
                     , window.jQuery().jquery); 
    };
});

jsfiddle http://jsfiddle.net/guest271314/3dhMM/

jQuery:

  • version: v2.1.2-pre e5190982c40d7ac8ab9bdb2e7e4334f0e123ef66

  • url: http://code.jquery.com/jquery-git2.js

  • date: 2014-07-14T09:04Z