Test every change bewteen before onkeyup and after onkeyup event fire? it does not sound it matter about that compare. try it as follows:<INPUT TYPE="text" NAME="txt" onkeyup="(this.value!=preval)?alert('Alter'):alert('Same')" onkeydown="preval=this.value">another method of compare: <INPUT TYPE="text" NAME="txt" onfocus="preval=this.value" onblur="(this.value!=preval)?alert('Alter'):alert('Same')">
it does not sound it matter about that compare.
try it as follows:<INPUT TYPE="text" NAME="txt" onkeyup="(this.value!=preval)?alert('Alter'):alert('Same')" onkeydown="preval=this.value">another method of compare:
<INPUT TYPE="text" NAME="txt" onfocus="preval=this.value" onblur="(this.value!=preval)?alert('Alter'):alert('Same')">
这个事件是改变之前触发的