如果不想让inpu缓存之前的数据,有以下方式
方法一:
在不想使用缓存的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>
方法三 不让页面读取缓存数据
<meta http-equiv= "Pragma" content= "no-cache" />
<meta http-equiv= "Cache-Control" content= "no-cache" />
<meta http-equiv= "Expires" content= "0" />
查看的是https://blog.csdn.net/weixin_41049850/article/details/80996605 这里的方式 亲测有效