How to detect was input value changed or not on blur
event?
For example every input field have default value (can be empty), after current input loses it’s focus we should determine, have the value been changed.
How to do this?
Advertisement
Answer
compare the value and the defaultValue
<input onblur="if(this.value!=this.defaultValue){alert('changed');}">