Here is a table of the different events and the levels of browser support. You need to pick an event which is supported across at least all modern browsers.
As you will see from the table, the keypress
and change
event do not have uniform support whereas the keyup
event does.
Also make sure you attach the event handler using a cross-browser-compatible method...