Skip to content
Related Articles

Related Articles

How to define a drop-down list in HTML5 ?
  • Last Updated : 11 Jun, 2020

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
Recommended Articles
Page :