Why after adding elements to the document the addEventListener stop working?
I have two .addEvenetListener in my code but one of them stop working after adding a div to my document.addEventListener("mousemove", (e) => { mouseMove(e) }, false); document.body.addEventListener("click", function(e){ e = e || window.event; if (e.which == 1) fire(); }, false); function fire(){ let bullet = `<div class="bullet" style="left:${shooterPlace.x}px;top:${shooterPlace.y}px;"></div>`; document.getElementById("space").innerHTML += bullet; } After clicking, the… Read More Why after adding elements to the document the addEventListener stop working?