HTMl Drop Down List



Creating drop down list in HTML

We create drop down list in a webpage when we want the site

visitor to choose from list of options.

The drop-down list serves as a form of information capture and it is a very quick

way of gathering input from site visitors as they do not have to spend time

typing details out in the form.

It is created by the using <select> tag.

Here is how to create it in html:

<h1 class="content">
<html>
<form>
<select name="bikes">
<option value="Honda CBR">Honda CBR</option>
<option value="Ninja">Ninja</option>
<option value="HayaBusa">Hayabusa</option>
<option value="Harley Davidson">Harley Davidson</option>
</select>
</form>
</html>

Choose your favourite bike.

Drop down list example

You can also select a particular bike in preference to

others.A simple change in the above code will do.

Example of selected drop down list.

<h1 class="content"><html>
<form>
<select name="bikes">
<option value="Honda CBR">Honda CBR</option>
<option value="Ninja">Ninja</option>
<option value="HayaBusa">Hayabusa</option>
<option value="Harley Davidson" selected="selected">Harley Davidson</option>
</select>
</form>
</html>

Choose your favourite bike.