D
D
Dubrovin2018-03-02 11:08:08
JavaScript
Dubrovin, 2018-03-02 11:08:08

Is it possible to see the list of addEventListener handlers on an element?

Is it possible to somehow see the list of handlers added via addEventListener on an element?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RidgeA, 2018-03-02
@Dubrovin

If it's in chrome - https://developers.google.com/web/tools/chrome-dev...
If it's not in the code, as far as I know, except to override the add handler function and keep track of it yourself.

T
twobomb, 2018-03-02
@twobomb

No, you can't, at least there is no legal way like "getAllEventListeners". As an option, only when assigning a handler, add it to some array or the like. and bind to the element, and when it needs to be removed via removeEventListener.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question