<!DOCTYPE html>
<html>
<body>
<h1>input autocomplete 属性</h1>
<p>这里我们有一个表单,其 autocomplete 属性设置为“new-password”,这意味着我们在这里期待一个新密码,因此浏览器不需要尝试填写此表单。</p>
<form action="/demo/action_page.php">
<label for="username">用户名:</label>
<input type="text" id="username" name="username"><br><br>
<label for="password">密码:</label>
<input type="password" id="password" name="password" autocomplete="new-password"><br><br>
<input type="submit">
</form>
<p>如果我们删除 autocomplete="new-password" 属性,会发生什么情况:</p>
<form action="/demo/action_page.php">
<label for="username">用户名:</label>
<input type="text" id="username" name="username"><br><br>
<label for="password">密码:</label>
<input type="password" id="password" name="password"><br><br>
<input type="submit">
</form>
</body>
</html>