Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all events attached to an element using jquery .live()?

Tags:

jquery

I would like to know how to list a list all events attached to a particular DOM element which had been attached using live()?

like image 279
GibboK Avatar asked Jun 13 '13 14:06

GibboK


1 Answers

try following code:

function findEvents(element) {

    var events = element.data('events');
    if (events !== undefined) 
        return events;

    events = $.data(element, 'events');
    if (events !== undefined) 
        return events;

    events = $._data(element, 'events');
    if (events !== undefined)
        return events;

    events = $._data(element[0], 'events');
    if (events !== undefined)
        return events;

    return undefined;
}

we're trying to use different ways cause it depends on jquery version. JSFiddle sample

like image 199
Sergio Avatar answered Sep 19 '22 13:09

Sergio