Keypress function in native javascript
<p>Below is my code:</p>

<pre><code>$(document).keypress(function(e){
  var s = String.fromCharCode(e.which);
  if ( s === "f"){
    alert ("its f");
  }
  else if ( s === "r"){
    alert ("its r");
  }
});
</code></pre>

<p>I wanna do this in JavaScript...........!!</p>

<p>How can i do this ?</p>
