title: Adding event as parameter within function, using addEventListener (Doesn't work in Firefox/IE)
body: <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;FML&lt;/title&gt;
  
  &lt;script type=&quot;text/javascript&quot;&gt;
  
  function function1(e, div) {
  div.innerHTML=&quot;this works&quot;
  document.getElementById('myspan').innerHTML= 'x-pos on click: ' + e.clientX
  div.addEventListener(&quot;mousemove&quot;, function(){test(event, this)}, true);
  }
  
  function test(e, div) {
  div.innerHTML+='&lt;br/&gt;so does this'
  //This doesn't work. Can't add event as a parameter to function that has to be executed when using addEventListener
  document.getElementById('myspan2').innerHTML= 'y-pos on move: ' + e.clientY
  }
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;span id=&quot;myspan&quot;&gt;&amp;nbsp;&lt;/span&gt;
  &lt;span id=&quot;myspan2&quot;&gt;&amp;nbsp;&lt;/span&gt;
  &lt;div style=&quot;width:100px;height:100px;background-color:blue;overflow:hidden;&quot;  onclick=&quot;function1(event, this)&quot;&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>Click on the blue div.</p>
  <p>I want to add the event <code>mouseover</code>, have it execute the <code>test()</code>-function which should contain following parameters: this, event</p>
  <p>When the function <code>test(e, div)</code> is called I keep getting an &quot;event is undefined&quot; error in Firefox and IE, although ironically enough it works perfectly in Chrome and Safari.</p>
  <p>Any way I can add the event parameter by using <code>addEventListener</code>? I can get it to work with <code>window.event</code> in Chrome and Safari, but this is the exact setup that I want. I've been googling and trial/erroring for a while now, without success... so FML :/ Any tips/hints/... besides shooting myself in the head?</p>
  <p>I know jQuery would probably solve all this, but I want to be proficient in Javascript before migrating to jQuery. Or should I migrate anyway?</p>