在jQuery中显示选择下拉列表? [英] Show select dropdown in jQuery?
本文介绍了在jQuery中显示选择下拉列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用jQuery在select元素上显示下拉列表?
Is it possible to make the dropdown on a select element visible with jQuery?
我尝试使用 $('#dropdown')。click();
,但没有效果。
I tried using $('#dropdown').click();
, but it has no effect.
推荐答案
这是不可能的。您只能实现自己的选择框,但这对于可用性是不利的。
This is not possible. You can only implement your own select-box, but this is bad for usability.
另一种方法是以编程方式更改选择框的大小属性,但这不是真的你想要的。
another approach is to programmatically change the size-attribute of the select-box, but this is not really what you wanted.
我建议你想想你为什么需要这个,如果会有更好的软件模式?
I suggest to think of why you need this and if there would be a nicer software-pattern?
这篇关于在jQuery中显示选择下拉列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文