0

I am trying to get the list of event listeners that are already attached to the element. Right now I have tried using:

getEventListeners(el)

This works fine while using in Chrome. Otherwise, using this code in Javascript gives me the error.

Uncaught ReferenceError: getEventListeners is not defined

Is there any alternate solution to it? Or the same method can be used in Javascript?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
زوہیب خان
  • 390
  • 1
  • 7
  • 21
  • Check if your question doesn't have an answer somewhere else already: https://stackoverflow.com/questions/446892/how-to-find-event-listeners-on-a-dom-node-in-javascript-or-in-debugging – n1kkou Nov 15 '21 at 08:16
  • Welcome to Stack Overflow! Visit the [help], take the [tour] to see what and [ask]. Please first ***>>>[Search for related topics on SO](https://www.google.com/search?q=javascript+get+event+listeners+of+element+site:stackoverflow.com)<<<*** and if you get stuck, post a [mcve] of your attempt, noting input and expected output using the [`[<>]`](https://meta.stackoverflow.com/questions/358992/ive-been-told-to-create-a-runnable-example-with-stack-snippets-how-do-i-do) snippet editor. – mplungjan Nov 15 '21 at 08:17

0 Answers0