How to define a drop-down list in HTML5 ?

In this article, we define a Drop-Down List By using the <select> Element in the Document. This tag is used to create a drop-down list. The <select> tag contains <option> tag to display the available option of drop-down list.
Note: The tag is used in a form to receive user response.
Syntax: 
 

<select>
    <option>
    <option>
    ...
<select>

Examples: 
 

html

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html> 
<html
  
<head
    <title
        HTML5: How to define a drop-down list?
   
    </title
</head
  
<body style="text-align:center;"
    <h1>GeeksforGeeks</h1
      
    <h2>HTML5: How to define a drop-down list?
</h2
      
      
<p>Select one option from drop-down list:</p>
   
      
    <select
        <option value="GFG">GFG</option
        <option value="OS">OS</option
        <option value="DBMS">DBMS</option
        <option value="Data Structure"
            Data Structure 
        </option
    </select
</body
  
</html>                     

chevron_right


Output : 
 

Supported Browsers are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

 

full-stack-img

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.