Are DOM Element Listeners Removed from Memory in JavaScript?



In modern browsers, if a DOM Element is removed, its listeners are also removed from memory in javascript.

Note that this will happen ONLY if the element is reference-free. Or in other words, it doesn't have any reference and can be garbage collected. Only then its event listeners will be removed from memory.

Updated on: 2019-12-02T05:35:14+05:30

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements