after you gave him your "clever" answer, you should have followed up with mentioning that keypress is the wrong event to use, but rather "keyup", since keypress varies across browsers and doesn't account for the holding down of keys. try holding down a key in your demo to see what happens :)
You want the oninput event, but IE < 10 has horrible support for it. Figuring out when the input value has changed is a lot more complicated than picking one of onkeyup/down/pressed.