清除input输入框的历史记录

当之前的input框输入了数据后,下次输入有历史记录问题的解决方法

<input id="vhcl_no"  type="text"  autocomplete="off">

input的属性autocomplete默认为on其含义代表让浏览器自动记录之前输入的值

如果想要关闭记录可以在input中加入autocomplete="off"

  1.  //js给input框赋属性
  2. document.getElementById("vhcl_no").autocomplete = "off";
  3. $("#vhcl_no").attr('autocomplete', 'off'); 

 

posted @ 2020-09-04 09:13  void9main  阅读(987)  评论(0)    收藏  举报