title: Removing letters entered in input on keydown removes numbers instead?
body: <p>I'm trying to build a telephone input that updates with dashes on keydown, when a user enters a letter I'm trying to instantly remove that character entry by using <code>this.value.slice(0, -1)</code> but this removes the last number instead. Would anyone be able to explain how this is happening?</p>
  
  <p><strong>JS</strong></p>
  
  <pre><code>var isNumber = validateNumber(event);
  
      if (isNumber) {
          if (inputLength == 3) {
              this.value = this.value + '-';
          } else if (inputLength == 7) {
              this.value = this.value + '-';
          }
      } else {
          var newValue = this.value.slice(0, -1);
          this.value = newValue;
      }
  </code></pre>
  
  <p>Fiddle: <a href="http://jsfiddle.net/cm803xuu/4/" rel="nofollow">http://jsfiddle.net/cm803xuu/4/</a></p>