900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > html input标签清除历史输入记录下拉框

html input标签清除历史输入记录下拉框

时间:2022-08-08 16:53:27

相关推荐

html input标签清除历史输入记录下拉框

一、在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”

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。