清除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'); 
原文地址:https://www.cnblogs.com/void9main/p/13611824.html