在Firefox里面input的值会被缓存起来,刷新页面之后,会恢复成刷新之前的值。有的时候我们并不希望这么做,可以用autocomplete=”off”来阻止Firefox的默认机制。

比如下面的代码,在刷新页面之后input的值全部为空。

 <form> 
<input autocomplete="off" type="text" /><br /> 
<input autocomplete="off" type="text" /><br /> 
 <input autocomplete="off" type="text" /><br /> 
<input autocomplete="off" type="text" /><br /> 
</form>

为了方便也可以这样写:

查看源代码打印帮助

 <form autocomplete="off"> 
 <input type="text" /><br /> 
 <input type="text" /><br /> 
<input type="text" /><br /> 
<input type="text" /><br /> 

</form> 



Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐