Can jQuery check whether input content has changed?

前端 未结 9 1054
轮回少年
轮回少年 2020-12-23 19:30

Is it possible to bind javascript (jQuery is best) event to \"change\" form input value somehow?

I know about .change() method, but it does not trigger

9条回答
  •  鱼传尺愫
    2020-12-23 20:04

    I don't think there's a 'simple' solution. You'll probably need to use both the events onKeyUp and onChange so that you also catch when changes are made with the mouse. Every time your code is called you can store the value you've 'seen' on this.seenValue attached right to the field. This should make a little easier.

提交回复
热议问题