title: How to call a function on html event with context?
body: <p>I want to access event properties in a js function which is called on html onkeypress event.</p>
  
  <p>HTML code</p>
  
  <pre><code>&lt;input type="text" id="name" name="name" placeholder="Name" onkeypress='keypress_event()'&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>function keypress_event(event)
  {
      console.log(event.charCode);
  }
  </code></pre>