title: When pasteing value into input area, can't capture value
body: <p>I have a button and an input area. When the input's length is filled (14) - then the button's class will be active. That currently works, however, when the user pastes a value into the input area, the length is zero until the user enters something else. My goal is to display the active class on the button when the paste is done if the length of the value is 14. </p>
  
  <p>JS</p>
  
  <pre><code> $('#number', '#form')
     .keydown(function (e) {
      var key = e.charCode || e.keyCode || 0;
      $phone = $(this);
      $len = $phone.val().length;
      console.log($len);
      // Auto-format
      if (key !== 8 &amp;&amp; key !== 9) {
          if ($phone.val().length === 13){
              $('#form div a:eq(0)').removeClass('inactive');
          }
          if (($phone.val().length === 14) &amp;&amp; (key == 13)){
              e.preventDefault(); 
              $('#form div a:eq(0)').trigger('click');
          }
          if ($phone.val().length &lt; 13){
              $('#form div a:eq(0)').addClass('inactive');
          }
      }
      if (key == 8){
          $('#form div a:eq(0)').addClass('inactive');
      }
  
      // Allow numeric, tab, backspace, delete, and arrow keys only
      return (
          key == 8 || 
          key == 9 ||
          key == 46 ||
          key == 86 || //copy+paste
          key == 67 ||
          key == 17 ||
          key == 91 || // end  
          (key &gt;= 37 &amp;&amp; key &lt;= 40)||
          (key &gt;= 48 &amp;&amp; key &lt;= 57) ||
          (key &gt;= 96 &amp;&amp; key &lt;= 105)
      ); 
  });
  
   document.getElementById('number').addEventListener('input', function (e) {
   var x = e.target.value.replace(/\D/g, '').match(/(\d{0,3})(\d{0,3})(\d{0,4})/);
  e.target.value = !x[2] ? x[1] : '(' + x[1] + ') ' + x[2] + (x[3] ? '-' + x[3]   : '');
   });
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>      &lt;form id="form"&gt;
              &lt;input id="number" type="text" maxlength="14" placeholder='(100) 100-1000'&gt;
              &lt;div&gt;
                  &lt;a class='bt inactive'&gt;Enter&lt;/a&gt;
              &lt;/div&gt;
          &lt;/form&gt;
  </code></pre>