SQL PHP HTML JavaScript articles and free code
 

Drop-Down list box

Dropdown Menu is one of the most flexible object in HTML. It is similar to that of radio button i.e, only one item can be selected from a group of items but the only difference is Dropdown menu occupies less space on the for when compared to Radiobutton and people can view one item at a time.

Dropdown Menu can be created as :

<select>
<option> ... </option>
<option> ... </option>
</select>


Attributes of Dropdown Menu:
Attributes of <select>...</select>:
Name: Specifies the name of the object through which it can be referenced.
Size: Used to specify the number of visible items in the list.
Multiple:  If given yes, then multiple choices can be made.

Attributes of <option>...</option>:
value: Used to specify the value to be submitted if the form has been submitted.
selected: Default selection of the item.

Example:
Favourite color: 
<select name="ddl">
<option>Blue</option>
<option>Green</option>
<option>Red</option>
<option selected>Select a Color </option>
</select>

This will give the output like :

Favourite Color: 

Form Fields  | Text Field  | Hidden Field  | Password Field  | TextArea  | RadioButton  | Checkbox  | Button  | Image Button  | Submit Button  | Reset Button  | Drop-Down Menu
Discuss this tutorial at forum

List of HTML Tutorials

 

Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.

Scripts
PHP
JavaScript
List of HTML Tutorial
<Form>
HTML Tags
Color Chart
HTML Calendar
Tags on web page
Web Design
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.