ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

26-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>

Facebook Comments

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked *

ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!