Search code examples
htmlgoogle-chrome

Input elements should have autocomplete attributes


I am getting this message in the console I can't understand it:

[DOM] Input elements should have autocomplete attributes (suggested: "current-password"): <input type=​"password" name=​"password">​

Here is the code that is causing the message:

<!DOCTYPE html>
<html>
<head>
    <title>registration page</title>
</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>

I have been provided with a link in the console but I am unable to understand it.


Solution

  • Try changing

    <input type="password" name="password">
    

    to

    <input type="password" name="password" autocomplete="on">
    

    Autocomplete lets web developers specify what (if any) permission the user agent has to provide automated assistance in filling out form field values, as well as guidance to the browser as to the type of information expected in the field.

    It's pretty powerful.