title: How to remove an event listener in javascript?
body: <p>I am wondering how can I remove an event listener after adding one, the way you use on and off in jquery?</p>
  
  <pre><code>document.removeEventListener('touchstart');
  document.addEventListener('touchstart', function (e) {
       closePopupOnClick(e, popup);
  });
  </code></pre>
  
  <p>but this does not actually remove the event listener.  If I put the addEventListener code in a function and pass that function into the the removeEventListener it will not work bc you cannot pass params into the function.  Anyone know how to do this?</p>