firefox 和 ie 的浏览器各自实现了input历史记录的功能,可以简化输入时的麻烦,但是,有时候弹出的下拉框会挡住页面显示内容,而且在某些情况下也不需要对input框进行记录,如号码查询的input框,用户不会对同一个号码进行多次查询,就没有必要让浏览器记录。
MSIE自定义了input 的扩展属性 autocomplete,置为off即可
<input type="text" autocomplete="off" id="number"/>
用这个方法可以屏蔽MSIE,Firefox则需要使用另一个扩展属性disableautocomplete
<input type="text" disableautocomplete id="number"/>
两扩展属性可以同时使用,浏览器会根据自身特性自动解析。
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Autocompletion, which was first introduced by Microsoft Internet Explorer, is the browser feature of remembering what you entered in previous text form fields with the same name. So, for example, if the field is named name and you had entered several variants of your name in other fields named name, then autocompletion provides those options in a dropdown. This image shows autocompletion being used in a form field:
Generally autocompletion is a useful browser feature, but occasionally it can be harmful. If the form field contains information such as a credit card number that should be left stored on the user's hard drive then you should turn autocompletion off. You can turn it off by setting AUTOCOMPLETE to OFF.
http://www.htmlcodetutorial.com/forms/_INPUT_AUTOCOMPLETE.html