HTML选择框列表大小计数 [英] HTML selectbox List size count

查看:102
本文介绍了HTML选择框列表大小计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以控制选择框的下拉列表大小?实际上,已经有一个名为 SIZE 的属性。但是我的要求是,当我单击该选择框时,将填充选项,在该列表中我可以控制大小。

Is it possible to control the selectbox dropdown size? Actually a property called SIZE is already there. But my requirement is, when I click that select box, options are populating, in that list can I control the size..

推荐答案

尝试一下。我想这就是您要寻找的东西。

try this. I think this is what you are looking for.

<select name="select1" onmousedown="if(this.options.length>5){this.size=5;}" onchange="this.size=0;" onblur="this.size=0;" style="position: absolute">
<option>a</option>
<option>b</option>
<option>c</option>
<option>d</option>
<option>e</option>
<option>f</option>
<option>g</option>
<option>h</option>
<option>i</option>
<option>j</option>
<option>k</option>
<option>l</option>
</select>

这篇关于HTML选择框列表大小计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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