Does remove a DOM object (in Javascript) will cause Memory leak if it has event attached?
- by seatoskyhk
So, if in the javascript, I create a DOM object in the HTML page, and attach event listener to the DOM object, upon I remove the the DOM from HTML page, does the event listener still exist and causing memory leak?
function myTest() {
var obj = document.createElement('div');
obj.addEventListener('click', function() {alert('whatever');…