输入元素应具有自动完成属性
2022-08-30 09:15:44
我在控制台中收到此消息,我无法理解它。请仔细研究
<!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"):
我在控制台中提供了一个谷歌链接,它将我带到(更多信息:goo.gl/9p2vKq)