我有这个代码:
html:
<input id="register_username" type="text">
<input id="register_password" type="text">
<input id="register_repeatpassword" type="text">
<input id="register_email" type="text">
Jquery:
$(document).ready(function(){
$('#register_username').attr('autocomplete','off');
$('#register_password').attr('autocomplete','off');
$('#register_repeatpassword').attr('autocomplete','off');
$('#register_email').attr('autocomplete','off');
});
我想禁用某些浏览器提供的自动完成功能,并实际上让用户输入整个字段,但代码不起作用,下拉菜单仍然出现,用户仍然可以选择之前输入的内容。我也尝试过使用autocomplete="off"
但什么也没发生。我在这里做错了什么?
只需添加:
autocomplete="off"
作为属性INPUT
元素,例如:
<input autocomplete="off" id="register_username" type="text" name="username">
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)