一、在html 中。如果input标签是放在form表单中的话是会有历史记录的。
比如:
<!DOCTYPE html><html><head></head><body ><form action="" method="post"><input type="text" name="text1" /><input type="text" name="text2" /><button type="submit">提交</button></form><input type="text" name="text3"></body></html>
form表单里的两个input是会有历史记录的。
二、清除历史记录下拉框
如果我们不需要历史记录提醒可以:
方法一:
加入autocomplete=“off”
<!DOCTYPE html><html><head></head><body ><form action="" method="post"><input type="text" name="text1" autocomplete="off"/><input type="text" name="text2" autocomplete="off"/><button type="submit">提交</button></form><input type="text" name="text3"/></body></html>
如果加入了autocomplete="off"依然没有生效,则需要检查你的input 标签中是否有name属性,没有则需要加入name属性。
方法二:
请参考:Chrome ignores autocomplete=“off”