HTML <option> tag

HTML <option> tag : Definition

• The HTML <option> tag is used to choose an option from a dropdown list within <select> or <datalist> element.

• A dropdown list must contain at least one<option> element.

• The <option> tag can be used without using any attributes also, but you usually need the value attributes so that, at the time of form submission the datas will be sent to the server.

Html <option> tag example:

<!DOCTYPE html> 
        <title>option tag example</title>          
        <label class="paragraph" style="color: #000; font-size: 20px;">Course :</label>
            <option>Select Option</option> 
            <option value="html">HTML</option> 
            <option value="java">JAVA</option> 
            <option value="perl">PYTHON</option> 
            <option value="C++">C++</option> 
            <option value="php">PHP</option> 
            <option value="php">MYSQL</option> 

Output :