title: How can I remove a click event from an element in Javascript?
body: <p>I have a <code>&lt;div&gt;</code> element that has a click event attached to it using the following code:</p>
  <pre><code>var id = &quot;someId&quot;;
  var elem = document.getElementById(&quot;elemId&quot;);
  elem.addEventListener(&quot;click&quot;, function() { someFunction(id); }, false);
  </code></pre>
  <p>At a later point I copy the element and add it to another part of the <code>DOM</code>, but need to first remove the <code>click</code> event</p>
  <pre><code>var elem = document.getElementById(&quot;elemId&quot;);
  elem.removeEventListener(&quot;click&quot;, ???? , false);
  </code></pre>
  <p>I'm not sure how to reference the listener and so far nothing I have tried has removed the event from the element.</p>
  <p>Any ideas?</p>