Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(function() {
$('#clickMe').on('click', function() {
console.log('aaa');
});
// Memory leak;
var button = document.querySelector('#clickMe');
button.parentNode.removeChild(button);
// No memory leak;
// $('#clickMe').remove();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment