How to Add to a Dropdown List

Drop-down lists help you collect data from a user via an online form. They allow users to make a selection based on values in the menu list. A webpage can include multiple drop-down lists for different questions. Sometimes, menu items need to be modified after they are created. New options are added and items change. When an item is inserted into a drop-down list, other items automatically shift into place. Items can be added anywhere within the existing menu.

Things You'll Need

  • Text editor
Show More

Instructions

    • 1

      Start Notepad, TextPad, EditPad or your favorite text editor. Select "File" and "Open" from the menu. A dialog box opens. Find and double-click the HTML file containing the drop-down list that you want to modify.

    • 2

      Scroll to the drop-down list on your page. Its code will be similar to:

      <select>

      <option value="1">option1</option>

      <option value="2">option2</option>

      <option value="3">option3</option>

      </select>

    • 3

      Place your insertion point where you want the new menu item to go. To add it to the top of the menu, place your cursor directly between the "<select>" tag and first "<option>." To insert it after another item, place your cursor after the "</option>" tag for the item it will follow.

    • 4

      Insert the following code into your page:

      <option value="newitem">Added Item #1</option>

    • 5

      Replace "newitem" with the value that's sent when the form is processed. Replace "Added Item #1" with the text people see within the drop-down.

    • 6

      Repeat Steps 3-5 to add additional menu items.

    • 7

      Select "File" and "Save" to update the HTML file.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured