Limitthe number of visible items in dropdown list


is it possible to limit the number of displayed items in a dropdown list? for example list of countries will display only 5 and people scroll down to see the rest of the list?


Nope, for example in this facebook form : Facebook Sign up homepage, in the birthday, in the Day, when you click the arrow, you see 19 days, then you can scroll to see more. what if I want to show only 10 days there and people can scroll for more?

Use the size attribute of the select element to specify the count of visible items.

<select size="5">
    <option SELECTED />country1
    <option />country2
    <option />country3
    <option />country4
    <option />country5
    <option />country6
    <option />country7
    <option />country8
    <option />country9
    <option />country10

If you need detailed information, maybe the following links can help you:
size attribute, [URL=“”]select element.

thank you bu the size attribute will make 5 items visible BEFORE someone click on the arrow, I dont want this. I want 5 items to be visible AFTER the user click on the small arrow.

take the facebook sign up form example, After you click on the arrow, you see 19 days, and you can scroll for more. I want it the same, but to show 5 days only, After the user click on the arrow.

Is it possible?

It is not possible with the select element. Open the facebook sign up form in Internet Explorer and Firefox. In Internet Explorer you can see 30 items, in Firefox you can see 20 items. The maximum number of visible items depends on the browser and you cannot modify it.

You could create an expanding, scrolling div to mimic the functionality wanted. But that seems like overkill for something providing minimal user benefit - people are used to how droplists look in their browser of choice.