I am trying to get the text in a text box as the user types in it (jsfiddle playground):
Keep it simple. Use both onKeyPress() and onKeyUp():
onKeyPress()
onKeyUp()
This takes care of getting the most updated string value (after key up) and also updates if the user holds down a key.
jsfiddle: http://jsfiddle.net/VDd6C/8/