1

I'm wondering where is the callback function of addEventListener stored.

In the spec.whatwg, they say like this,

"Each EventTarget object has an associated event listener list (a list of zero or more event listeners). It is initially the empty list."

Is this all?

Then, how can we access that list by JavaScript ?

3
  • 1
    Have a look at this stackoverflow.com/questions/17238348/… it looks like it might help, I'm not too sure if that answers your question Commented Mar 2, 2022 at 18:39
  • 4
    You can not access the list of events attached to the element with JavaScript. Commented Mar 2, 2022 at 18:41
  • 3
    "Is this all?" - Is this not enough? And no, you cannot access this list from JavaScript, it's an implementation detail and there is no interface to expose it. Commented Mar 2, 2022 at 18:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.