input autocomplete

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


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值