html – 我可以禁止浏览器自动填充吗?

前端之家收集整理的这篇文章主要介绍了html – 我可以禁止浏览器自动填充吗?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
你知道浏览器如何自动填充文本框?显然这使用户感到困惑。他们认为它是一个简短的列表,只有有限的选择。

有谁知道如何禁用自动完成?

解决方法

禁用自动完成功能的正确方法是这样的:
<input type="text" name="foo" autocomplete="off"/>

要么

<form autocomplete="off" ... >

MSDN:autocomplete Property

Mozilla:How to Turn Off Form Autocompletion

Applicable browser versions: Netscape
6.2 (Mozilla 0.9.4) or later. IE 5 or later. …

This form attribute is not part of any web standards but was first introduced in Microsoft’s Internet Explorer 5. Netscape introduced it in version 6.2 — in prior versions,this attribute is ignored. The autocomplete attribute was added at the insistance of banks and card issuers — but never followed through on to reach standards certification.

原文链接:https://www.f2er.com/html/233042.html

猜你在找的HTML相关文章