Why does jQuery.keydown not fire the first letter I type? -
why jquery.keydown
not fire first letter type?
<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
Post a Comment