HTML selectbox Number of list items

Can I control the size of the selectbox dropdown menu? In fact, the SIZE property already exists. But my requirement is that when I click this checkbox, the parameters are filled in, in this list I can control the size.

0
source share
2 answers

try it. 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> 
0
source

With this you can limit the size.

 <select name="select" id="select" size="2" > <option>a</option> <option>b</option> <option>c</option> <option>d</option> <option>e</option> </select> 
0
source

Source: https://habr.com/ru/post/1347216/


All Articles