title: Stopping backspace on multiple browsers using jQuery
body: <p>I am attempting to stop a backspace <code>keydown</code> event from being handled by browsers, I'm using the jQuery library, so I need to get the original event, but on some browsers (Firefox at least) I get an error when trying to set the original events keyCode = 0, it gives and error saying that only a getter exists for that property.</p>
  <pre><code>function blockBackspace(event) {
      var altKey = event.originalEvent.altKey;
      var srcElementType = event.originalEvent.srcElement;
      if( (altKey) || ((event.keyCode == 8)  &amp;&amp; (srcElementType != &quot;text&quot; &amp;&amp; srcElementType != &quot;textarea&quot; &amp;&amp; srcElementType != &quot;password&quot;))
          || ((event.ctrlKey) &amp;&amp; ((event.keyCode == 78) || (event.keyCode == 82)) ) || (event.keyCode == 116) )
          {
          event.keyCode = 0;
          event.returnValue = false;
          event.originalEvent.keyCode = 0;
          event.originalEvent.returnValue = false;
          //sets process backspaceFlag to keep multiple handlers from removing text
          processBackspace = true;
      }
  }
  </code></pre>
  <p>So I'm not exactly sure what to do next, every solution I find yields more problems.  There must be ways around this problem or else other text areas (that's kind of what I'm building) would not work.</p>