如何以编程方式告诉 HTML SELECT 下拉(例如,由于鼠标悬停)? [英] How can you programmatically tell an HTML SELECT to drop down (for example, due to mouseover)?
问题描述
如何以编程方式告诉 HTML select
下拉(例如,由于鼠标悬停)?
How can you programmatically tell an HTML select
to drop down (for example, due to mouseover)?
推荐答案
你不能用 HTML 选择标签来做到这一点,但你可以用 JavaScript 和 HTML 做到这一点.有多种现有控件可以执行此操作 - 例如,附加到 SOinteresting/ignored tag"条目的suggest"列表,或 Gmail 对电子邮件地址的查找.
You can't do this with a HTML select tag, but you can do it with JavaScript and HTML. There are variety of existing controls that do this - for instance, the "suggest" list attached to the SO "interesting/ignored tag" entry, or Gmail's lookup for email adresses.
有许多 JavaScript+HTML 控件提供此功能——寻找自动完成控件以获得想法.
There are many JavaScript+HTML controls that provide this capability--look for autocomplete controls for ideas.
请参阅此链接以了解自动完成控件...http://ajaxcontroltoolkit.codeplex.com/
See this link for the Autocomplete control...http://ajaxcontroltoolkit.codeplex.com/
这篇关于如何以编程方式告诉 HTML SELECT 下拉(例如,由于鼠标悬停)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!