In Javascript, does the following create a memory leak
var button = document.createElement("input");
button.setAttribute("type","button");
button.addEventListener("click", myFunction);
button = null;
Do I have to remove the event listener first?
EDIT
Update to my question, I think that because I'm not actually adding this element to the DOM, then it's not a duplicate?