Home Tutorial Html Html5 HTML5 option tag, Example of <option>tag.

 
 

HTML5 option tag, Example of <option>tag.
Posted on: September 13, 2010 at 12:00 AM
Advertisement
In this section, you will see the use of <option>tag of HTML5.

HTML5 option tag, Example of <option> tag.

Here, you will see the use of <option> tag in HTML5. The <option> tag is used for providing option for drop-down list or selection list. Every thing presents in option tag will be display in drop down list. It is like a child of select tag , datalist, and optgroup tag. The <option> tag can be used without any attributes.

Attribute of option:
Attribute provides significant information about the option tag for the browser. There are following attributes......

Attributes Value Description
disabled disabled or empty Element does not receive focus of user.
selected selected or empty option automatically selected.
 label  string Define label for option.
value string Initial value of option.

Declaration Syntax :

Declaration syntax of <option> in HTML5.

                         <option attributes> Text </option >

Example of <option> in HTML5:

Code:
option_Tag.html
<!DOCTYPE html >
<html >
<head>
<title>Title of document</title>
</head>
<body>
<p><strong>option</strong><b> tag Example.</b></p>
<p><b>Implementation of &lt;option&gt; in HTML5.</b></p>
<select style="width: 139px">
<option></option>
<option>C</option>
<option>C++</option>
<option>JAVA</option>
<option disabled>PHP</option>
</select>
</body>
</html>
Output:

Download this code

Difference Between HTML5 and HTML4.01:

The <option> tag is available in both HTML5 and HTML4.01.

Advertisement

Related Tags for HTML5 option tag, Example of <option>tag.:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: September 13, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com