title: Unable to backspace in input type="number" using Chrome 64bit in Ubuntu 14.04. Works in Firefox
body: <p>I am trying to use the code below posted by Biff MaGriff for an <a href="https://stackoverflow.com/questions/1495219/how-can-i-prevent-the-backspace-key-from-navigating-back">earlier solution</a> to preventing backspace use that causes the browser to go back a page in history. My issue is that the code will not allow backspace (deletion) of characters in type="number".</p>
  
  <pre><code>$(document).keydown(function (e) {
      var preventKeyPress;
      if (e.keyCode == 8) {
          var d = e.srcElement || e.target;
          switch (d.tagName.toUpperCase()) {
              case 'TEXTAREA':
                  preventKeyPress = d.readOnly || d.disabled;
                  break;
              case 'INPUT':
                  preventKeyPress = d.readOnly || d.disabled ||
                      (d.attributes["type"] &amp;&amp; $.inArray(d.attributes["type"].value.toLowerCase(), ["radio", "checkbox", "submit", "button"]) &gt;= 0);
                  break;
              case 'DIV':
                  preventKeyPress = d.readOnly || d.disabled || !(d.attributes["contentEditable"] &amp;&amp; d.attributes["contentEditable"].value == "true");
                  break;
              default:
                  preventKeyPress = true;
                  break;
          }
      }
      else
          preventKeyPress = false;
  
      if (preventKeyPress)
          e.preventDefault();
  });
  </code></pre>
  
  <p>My code is as follows:</p>
  
  <pre><code>&lt;input id="tesnprice" type="number" step=0.01 name="price" size="50" maxlength="6" /&gt;
  </code></pre>