html - 无法在 chrome 上禁用自动完成功能
问题描述
我需要避免 chrome 用存储在浏览器上的登录数据填充某些字段,我尝试添加autocomplete="off"
, autocomplete="unknown-autocomplete-value"
但 chrome 它仍然填充这些字段,没有使用 javascript 的任何其他方式?
解决方案
你可以发布你的代码,因为在我的情况下它的工作。通过运行代码片段比较名字和姓氏
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<form action="form.php" target="_blank" method="post">
<label>First Name </label><input type="text" name="FirstName" autocomplete="off"><br><br>
<label>Last Name </label><input type="text" name="LastName"><br><br>
<label>Password </label><input type="password" name="password"><br><br>
<label>Male </label><input type="radio" name="gender"><br>
<label>Female </label><input type="radio" name="gender"><br>
<label>Others </label><input type="radio" name="gender"><br>
<label for=""></label>
<input type="submit" value="Submit">
</form>
</body>
</html>
推荐阅读
- python - 基于用户输入的numpy数组操作
- encoding - ASN.1 / DER 整数编码
- sql - 如何根据现有列获取列的值
- angular - 将 node_modules 中的 css 文件加载到具有 webpack 的 Angular 组件中
- c - 通过 char 数组中的标记获取参数
- java - 如何使用 intellij 正确远程调试 pod?
- asp.net-core - 根据验证程序,远程证书无效 - 无法解决此问题
- sql - 这个问题的正确查询是什么?
- mongodb - 如何创建查询以从 json 字符串中获取记录
- bash - 创建一个脚本以打印 : 字符之前的文本,每个输出在单独的行中