本文介绍了如何隐藏文本输入的浏览器生成的previous项目的下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我生成这样的文本输入:

When I generate a text input like this:

<input type="text" name="name" />

当我开始键入时,浏览器会显示输入文字的下方的下拉列表。这个列表包含pviously用于该浏览器在这种文本输入的值我$ P $。我想生成通过AJAX我自己的自动完成功能。

When I start to type, the browser will display a dropdown list below the text input. This list contains the values I previously used for this text input in this browser. I want to generate my own autocompletion via ajax.

我怎么知道有任何CSS或JavaScript浏览器不会产生这个下拉列表。

How do I tell the browser with either css or javascript to not generate this dropdown list.

如果这个任务是通过使用jQuery更容易,我想preFER这样的解决方案。

If this task is easier by using jquery, I would prefer such a solution.

推荐答案

IE和火狐(或者其他人,我没有研究它了)支持autocomplete属性。如果你将其设置为关闭这些浏览器将不再显示自动完成。

Both IE and Firefox (maybe others, I didn't research it much) support the autocomplete attribute. If you set it to "off" these browsers will no longer display the autocompletion.

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

这篇关于如何隐藏文本输入的浏览器生成的previous项目的下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 21:27