Why does jQuery.keydown not fire the first letter I type? -


why jquery.keydown not fire first letter type?

http://jsfiddle.net/astrc/

<input id="foo" type="text"> <div></div>  $("#foo").on('keydown', function(e){     $("div").text(this.value); }); 

i see fire on 2nd keydown press, not first.

when keydown event being fired, value in textbox hasn’t changed yet. seems you’re looking input event anyways (use 'input keyup' backwards compatibility). updated fiddle


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -