They only stay in memory if there are references to said element. See this answer.
Solution 1 :
Problem :
If I want to save on memory, does an event listener need to be deleted from an element if the element is already deleted. If I do something like this:
temp_canvas = document.createElement('canvas');
temp_canvas.id = 'temp_canv';
$("#temp_canv").mousedown(e => {this.line_down(e);});
document.getElementById("temp_canv").removeEventListener('mousedown', line_down(e));
Does this remove the memory of the event listener along with the canvas element?
Thanks