问题:
When using the xhtml1-transitional.dtd
doctype, collecting a credit card number with the following HTML使用xhtml1-transitional.dtd
文档类型时,使用以下 HTML 收集信用卡号
<input type="text" id="cardNumber" name="cardNumber" autocomplete='off'/>
will flag a warning on the W3C validator:将在 W3C 验证器上标记警告:
there is no attribute "autocomplete".没有属性“自动完成”。
Is there a W3C / standards way to disable browser auto-complete on sensitive fields in a form?是否有 W3C / 标准方法来禁用表单中敏感字段的浏览器自动完成功能?
解决方案:
参考一: https://stackoom.com/question/2RT2参考二: Is there a W3C valid way to disable autocomplete in a HTML form?