第2个回答 2017-11-15
用一个变量存一下上次的值就行了。 Examples window.onload=function(){ var oText=document.getElementById("text"); var oBtn=document.getElementById("button"); var old=oText.value; oText.onblur=function(){ if(oText.value!=oBtn.innerHTML){ oText.value=old; }; } } 123 ...