Selection list is an option in which user can select single or multiple options from a given list. In this option multiple inputs are available but some options can be displayed at a time. Scrolling Lists and Pull-Down pick lists are created with the<select>tag. You can use this tag together with the<option>tag: <select>
<option> windows</option><option> Linux </option><option> Mac</option>
</select>
No html tags other than <option> and </option> should appear between the <select> and </select> tags.
Attributes of select tag:
Select tag has following attributes-
1. Size Attribute:
Size determines how many items are shown at once on the selection list. If size =”3″ were used in the preceding code, only the first three options would be visible, and a scrollbar would appear next to the list so the user could scroll down to see the third option.
Ex : <Select name – ‘Weekday” size=4>
2. Name:
It is used to define name to the drop down menu.
<Select name =”WeekDay” size=4 multiple>
3. Multiple:
This is used to select multiple options from the given list. This is the value which has to be given back to the website and defined in the option tag.
Ex : <optionValue=”Sunday”>Sunday
When this option is used the given option will be preselected.