Jquery:键入时过滤下拉列表 [英] Jquery: Filter dropdown list as you type

查看:158
本文介绍了Jquery:键入时过滤下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了一个原型插件,可以在您键入时过滤下拉列表的内容。因此,例如,如果您在文本框中键入cat,则只有包含子字符串cat的项目才会在下拉列表中保留为选项。

I have used a prototype plugin which filters the contents of a dropdown as you type. So for example if you typed 'cat' into the text box, only items containing the substring 'cat' would be left as options in the drop down.

有没有人知道一个jquery插件可以做到这一点?

Does anyone know of a jquery plugin which can do this?

推荐答案

我写了一个小脚本来做这个几年前。它很可能很容易打包成jQuery插件。欢迎你。

I wrote a little script to do this a few years ago. It could be packaged up as a jQuery plug-in quite easily, probably. You're welcome to it.

我也在我的 PHP函数参考仪表板小部件,如果你想查看那里的代码。

I also do this in my PHP Function Reference Dashboard widget if you want to look at the code there.

这篇关于Jquery:键入时过滤下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆