title: Javascript: Pass event AND element reference
body: <p>I want an input field which calls a javascript function, if a key is pressed. But I'm not able to pass the event as well as an element reference. I can either pass the event:</p>
  
  <pre><code>&lt;input type="text" name="chmod" value="644" onkeypress="chmod(e)"&gt;
  </code></pre>
  
  <p>or pass the element reference:</p>
  
  <pre><code>&lt;input type="text" name="chmod" value="644" onkeypress="chmod(this)"&gt;
  </code></pre>
  
  <p>If I try to pass both there occurs an error:</p>
  
  <pre><code>&lt;input type="text" name="chmod" value="644" onkeypress="chmod(e, this)"&gt;
  
  Uncaught ReferenceError: e is not defined
  </code></pre>
  
  <p>Is there any way to pass both, the event and a reference to the element?</p>
  
  <p>Cheers, Marco</p>