我在控制台中收到此消息,我无法理解。请调查一下
<!DOCTYPE html>
<html>
<head>
<title>registration page</title>
<script src="js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('form').submit(function(event){
"use strict";
var valid = true,
message = '';
$('.error').remove();
$('form input').each(function() {
var $this = $(this);
if(!$this.val()) {
message='';
var inputName = $this.attr('name');
valid = false;
message += 'Please enter your ' + inputName + '\n';
$(this).closest('div').append('<div class="error">'+message+'</div>');
}
})
if(!valid){
event.preventDefault();
}else{
$('form').serialize()
}
})
})
</script>
</head>
<body>
<form>
<div>
<label>Name</label>
<input type="text" name="name"><br>
</div>
<div>
<label>File</label>
<input type="file" name="file"><br>
</div>
<div>
<label>password</label>
<input type="password" name="password"><br>
</div>
<button type='submit'>Submit</button>
</form>
</body>
</html>
问题是尽管没有错误,但我一直收到此消息
[DOM] Input elements should have autocomplete attributes (suggested: "current-password"):
我在控制台中获得了一个 google 链接,该链接将我带到 (更多信息:goo.gl/9p2vKq)
原文由 vinayak shahdeo 发布,翻译遵循 CC BY-SA 4.0 许可协议
尝试改变
至
自动完成 功能让 Web 开发人员可以指定用户代理在填写表单字段值时必须提供哪些(如果有)权限,并指导浏览器了解字段中预期的信息类型。
它非常强大。