自动填充应使用以下< input>类型:文本,搜索,网址,电话,电子邮件,密码,日期选择器,范围和颜色.
但是,你可以尝试在你的< form>中添加autocomplete =’off’.标记而不是< input>标签,除非有什么东西阻止你这样做.
如果这不起作用,您也可以使用JavaScript:
if (document.getElementsByTagName) {
var inputElements = document.getElementsByTagName(“input”);
for (i=0; inputElements[i]; i++) {
if (inputElements[i].className && (inputElements[i].className.indexOf(“disableAutoComplete”) != -1)) {
inputElements[i].setAttribute(“autocomplete”,”off”);
}
}
}
或者在jQuery中:
$(document).ready(function(){
$(':input').live('focus',function(){
$(this).attr('autocomplete', 'off');
});
});