Html 如何清除文本输入的历史记录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17802690/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 11:25:37  来源:igfitidea点击:

How to clear history of text input

htmlbrowser

提问by Aditya Ponkshe

In my html page I have multiple text inputs. Every time I enter values in them it shows me previously entered values. Is it due to browser property or html? how do I disable it?

在我的 html 页面中,我有多个文本输入。每次我在其中输入值时,它都会显示我之前输入的值。是由于浏览器属性还是html?我如何禁用它?

回答by Arun Bertil

Always the better appraoch is to give formautocomplete="off"

总是更好的方法是给formautocomplete="off"

<form autocomplete="off">

<input type="text" id="text1">
<input type="text" id="text2">

</form>

Then only newer versions of Eclipse support HTML5 tags such as autocomplete else it will show warning...

那么只有较新版本的 Eclipse 支持 HTML5 标签,例如自动完成,否则它会显示警告...

回答by mohkhan

Just set the autocompleteproperty of your textboxes to off. Like this...

只需将autocomplete文本框的属性设置为关闭。像这样...

<input type="email" name="email" autocomplete="off">

回答by kashimu

i think it is related to this question autocomplete

我认为这与这个问题自动完成有关

try to used javascript to add attribute autocomplete to your form

尝试使用 javascript 向表单添加属性自动完成功能

someForm.setAttribute( "autocomplete", "off" ); someFormElm.setAttribute( "autocomplete", "off" );