Learn HTML step-by-step from A to Z or improve your professional skills.  Home HTML and CSS Tutorials Select Tags (Drop downs)
Your Ad Here

Select Tags (Drop downs)


The select tag, like the checkbox and radio button input tags allows your readers to choose from multiple options. However, because the options are all stored in a drop-down box, they do not take up as much screen real estate as the radio buttons and checkboxes.

The select tag has several attributes, and the closing </select> tag is required.

  • name (required) - names the input information
  • size - how many items in the list are showing on the screen at once
  • multiple - the reader can choose multiple items

Select Tags (Drop downs)

The tricky part of the <select> tag is that it needs a second tag to include the elements in the list, the <option> tag.

The option tag has two primary attributes:

  • value - if this is not included, the form will send the server whatever follows the option tag (up to the next option tag, or </select> tag) as the value
  • selected - if this is not included, the form will display the first element listed as the default selected choice

Here are three types of select lists:

Basic Select List

<select name="1" size="1">
<option>one
<option>two
<option>three
</select>

Basic Multiple Select List

<select name="2" multiple size="1">
<option>one</option>
<option>two</option>
<option>three</option>
</select>

Multiple Select with Multiple Showing

<select name="3" multiple size="2">
<option value="1">one</option>
<option value="1">two</option>
<option value="1">three</option>
<option value="1">four</option>
</select>



I hope this came in useful!



Author's URL: webdesign.about
Thank you for voting.
Rate this Materials:
Bad 
1 2 3 4 5 Excellent
print this page subscribe to newsletter subscribe to rss

HTML is Hyper Text Markup Language that is used to make hypermedia and hypertext documents for the Web. More HTML and CSS: Most Popular Materials | Fresh Materials | More HTML Tutorials at Markuptutorials.com

Add comments to "Select Tags (Drop downs)"

Only registered users can write comment

Reader's comments