HTML Drop Down Menu


 
 
 

  HTML Tutorial > HTML Form > Drop Down Menu

Drop down menu is another common way to specify input data. For example, selecting a state is often done via a drop down menu. Users can select one or more items in a drop-down menu. Below is an example for a single-selection drop down menu:

Code:
<select name=color>
<option value="red">Red</option>
<option value="green">Green</option>
<option value="blue">Blue</option>

In this case, the key is color, and the values can be either red, green, or blue, depending on the item selected.

If we want to pre-select a check box, we'll specify "selected" at the end of the <input> tag, such as follows:

<input type="checkbox" name="color" value="red" selected>Red<br>

If we want to select multiple items, we specify "multiple" at the end of the <select> tag, i.e.,

<select name=color multiple>



Next: HTML Color Codes

Site Map   |   Resources

Link to this page: If you find this page useful, we encourage you to link to this page. Simply copy and paste the code below to your website, blog, or profile.





    Copyright 2006, 2007, 2008 1keydata.com     Privacy Policy