Get .val() on keydown *not* keyup
问题 I'm writing a library that amends a widget to a text area, so I need to detect when the user starts typing something: this.$input.bind('keydown keyup', function() { if (this.$input.val() == …) { … } } The .val() only updates when keyup is triggered. That's too much of a delay. I want to know the state of the input box on keydown . Do you know of a library that improves .val() ? 回答1: too late? can't imagine a scenario where 10ms would make that much of a difference, but you could always