Solution 1 :

They only stay in memory if there are references to said element. See this answer.

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_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?