【发布时间】:2019-09-20 11:39:31
【问题描述】:
在某些页面上我收到了这个 chrome 警告:
[DOM] Found 2 elements with non-unique id #Name: (More info: https://www.chromium.org/developers/design-documents/create-amazing-password-forms)
<input disabled="disabled" id="Name" name="Name" />
<input id="Name" name="Name" type="hidden" />
我正在使用 Chrome:版本 77.0.3865.90(官方构建)(64 位)
我试图通过在 Chrome 中显示下一个代码来重复该问题,但没有警告?
两个相同的 ID 是否足以显示此警告?我错过了什么?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<input id="Name" name="Name" />
<input id="Name" name="Name" />
<input id="password" name="password" type="password">
</body>
</html>
编辑
即使您使用 form 包装输入元素,警告仍然不会显示
【问题讨论】:
标签: html google-chrome