How to find which event is attached to particular DOM element in JavaScript/jQuery ?

Forums JavaScriptHow to find which event is attached to particular DOM element in JavaScript/jQuery ?
Staff asked 4 years ago

I have a scenario like I want to debug the code which is new to me, so I need some way to find which events are attached to particular DOM elements.

Answers (1)

Add Answer
Staff answered 3 years ago
//syntax
$._data( $("element")[0], "events" );
//example
$._data( $("#Save")[0], "events" );

The result from $._data will be an object that contains both of the events as you can see below the image.

Subscribe

Select Categories