title: Javascript - Why is input value missing a character?
body: <p>I am trying to get this script to autofill another field while the original field is being filled in. But the second field loses the last character of its value. Any ideas why?</p>
  
  <pre><code>Here is the code... 
  
  &lt;input type="text" class="first" placeholder="type here"&gt;
  &lt;input type="text" class="second" placeholder="here it is the reuslt"&gt;
  
  $(".first").on('keydown',function(){
  $(".second").val($(this).val());
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/fmdwv/1/" rel="nofollow noreferrer">http://jsfiddle.net/fmdwv/1/</a> </p>