Skip to main content

What Is Drop-down List In HTML?

by
Last updated on 6 min read
What Is Drop-down List In HTML?

Need a drop-down list that actually works in 2026? Whether you're marking up a contact form, wiring up an Excel budget tracker, or building a React dashboard, the right technique saves time and headaches. Below you’ll find copy-paste-ready snippets plus pro tips that have survived browser updates, OS changes, and framework churn through 2026.

Quick Fix Summary

For HTML: wrap <option> tags inside <select id="myList"></select>.
For Excel 365 (build 2406+): use Data → Data Validation → Allow: List.
For React (2026): npm install react-select@5 and drop the <Select /> component.

An HTML drop-down list is a collapsible menu that shows one choice until clicked, then reveals all options.

What’s Happening

A drop-down list is a collapsible menu that shows a single visible choice until the user clicks or taps it, at which point the full list rolls out. In HTML it’s built with the native <select> element and one or more <option> children. Each option carries a value for form submission and display text for the user. The same concept appears in Excel as a cell-level list and in React apps as a richer, searchable component.

The simplest way to make a drop-down list is with the HTML <select> tag paired with <option> tags.

Step-by-Step Solution

1. Pure HTML (works in all browsers in 2026)

  1. Open your HTML file in any editor (VS Code, Notepad++, Sublime Text, etc.).
  2. Create a <select> tag with a unique id for CSS/JS targeting:
    <select id="country" name="country">
      <option value="" selected disabled>Choose a country…</option>
      <option value="us">United States</option>
      <option value="ca">Canada</option>>
      <option value="mx">Mexico</option>
    </select>
  3. Save the file and open it in Chrome, Firefox, Edge, or Safari (2026 versions).
  4. Click the control—the list should expand instantly.
To build a drop-down in HTML, wrap <option> tags inside a <select> tag with a unique id.

2. Excel 365 (build 2406, 2403, 2401)

  1. Open your workbook and select the cell or cells where the list should appear.
  2. Press Alt + D + V + V (or go to the ribbon: DataData Validation).
  3. In the dialog, set Allow to List.
  4. In Source, type your comma-separated choices or click the grid icon and drag the range (e.g., A2:A20). Click OK.
  5. A small arrow now appears in the cell; click it to reveal the drop-down choices.
In Excel, create a drop-down by selecting a cell, going to Data → Data Validation, choosing “List,” and entering your choices.

3. React (2026, Vite 5, React 18.3)

  1. Create or open a React project with Vite:
    npm create vite@latest my-dropdown --template react
    cd my-dropdown
    npm install
  2. Install the latest react-select:
    npm install react-select@5
  3. Replace the contents of src/App.jsx with:
    import Select from 'react-select';
    const options = [
      { value: 'apple', label: '🍎 Apple' },
      { value: 'banana', label: '🍌 Banana' },
      { value: 'orange', label: '🍊 Orange' }
    ];
    export default function App() {
      return