怎麼禁止自動填充瀏覽器記住的密碼

重點看標紅的

<input type="text" style="display:none" disabled autocomplete = "off"  value=" ">
 <input name="用戶名" type="text" id="username"  autocomplete="off"/><i>用戶名</i>
 <input type="password" style="display:none" disabled autocomplete = "off" value=" ">
 <input name="密碼" type="text" οnfοcus="this.type='password'" id="userpwd" autocomplete="off" /><i>密碼</i>

或者  <input name="密碼" type="password" readonly οnfοcus="this.removeAttribute('readonly');" id="userpwd" autocomplete="off" /><i>密碼</i>

 

在文檔加載完成後將用戶名、密碼輸入內框設置爲容空

window.load=function(){document.getElementById('密碼域ID').value='';};

或者

document.getElementById('username').value='';
                    document.getElementById('userpwd').value='';

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章