How can I check if a value is changed on blur event?

前端 未结 10 1223
时光说笑
时光说笑 2021-02-07 06:29

Basically I need to check if the value is changed in a textbox on the \'blur\' event so that if the value is not changed, I want to cancel the blur event.

If it possible

10条回答
  •  太阳男子
    2021-02-07 06:55

    Even if this is an old post, I thought i'd share a way to do this with simple javascript.

    The javascript portion:

    Now the text field in your form:

    And bewn! No Jquery needed. just simple javascript. cut and paste those bad boys. (remember to put your javascript above the body in your html)

提交回复
热议问题