欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

html禁止清除input文本输入缓存 博客分类: html html浏览器 

程序员文章站 2024-03-15 13:44:41
...
如果不想让浏览器缓存input的值,有2种方法:

方法一: 
在不想使用缓存的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>
相关标签: html 浏览器