Shamoon
Shamoon

Reputation: 43649

How can I use a jQuery event to detect changes in an input box?

If I use use $('element').change(..., it'll only detect when the element loses focus. I need to detect it constantly (keypress, copy/paste, etc)

Upvotes: 0

Views: 81

Answers (2)

SLaks
SLaks

Reputation: 888253

You should handle the input (browsers) and propertychange (IE) events.
This will catch drag&drop and paste events too.

Demo.

Upvotes: 2

Jeremy Battle
Jeremy Battle

Reputation: 1638

If you want it to detect constantly, use .keyup() instead of .change()

Upvotes: 1

Related Questions