多數瀏覽器默認會緩存input的值,只有使用ctl+F5強制刷新的才能夠清除緩存記錄。
若是不想讓瀏覽器緩存input的值,有2種方法: html
方法一:
在不想使用緩存的input中添加 autocomplete="off";
eg: <input type="text" autocomplete="off" name="test" /> 瀏覽器
方法二:
在 input 所在的form標籤中添加 autocomplete="off";
eg:
<form action="#" autocomplete="off">
<input type="text" autocomplete="off" name="test" />
</form> 緩存