26-HTML Select

0
247

This tutorial is all about HTML Select.
HTML select fields have similar functionality as HTML Checkbox Fields. This allows the user to choose one or more values from an established series of options.

 

The <select> tag is used in incorporating a select field into a web page and <option> tag is used in adding List values  to the field. It’s similar with the list items <li> tag that are added to an ordered list elements <ol>.

 

Example:

<select name="dropbox"> 
 <option value="d1" >dropbox 1</option>
 <option value="d2" >dropbox 2</option>
 <option value="d3" >dropbox 3</option>
</select>

 

 

Example on how to set a selectbox with a default value every time the HTML page is loaded:

<select name=”dropbox”>
<option value=”d1″ >dropbox 1</option>
<option value=”d2″ selected=”true” >dropbox 2</option>
<option value=”d3″ >dropbox 3</option>
</select>

 

Readers might read also:

 

 

Facebook Comments
(Visited 8 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here