Welcome Guest! (App Version 5.16)

websitnero logo name

HTML Select

Overview

  • <select> provides a list of dropdown items.
  • <multiple> attribute lets a user select more than one option.
  • <size> attribute controls the number of list items that are by default shown at user-screen.

Select Box in HTML

Select Box provides a dropdown having a list of options from which a user can select one or more options. Select box serves the same purpose as radio or checkbox buttons with the only difference being in Radio or Checkbox Buttons you can see all available options directly on screen while in case of Select Box you will need to open the dropdown to see options and make selection.

Example

<form>
  <select name="flower">
    <option value="rose">Rose</option>
    <option value="lily">Lily</option>
    <option value="lotus">Lotus</option>
  </select>
</form>

Output:

Multiple Selection in Select Box

Select box allows us to make multiple selection of the options provided in it. For it just add the multiple property in the select box using ctrl + left-click buttons.

Example

<form>
  <select name="flowers" multiple>
    <option value="rose">Rose</option>
    <option value="lily">Lily</option>
    <option value="marigold">Marigold</option>
  </select>
</form>

Output:

Further Reading

1. <select>

WebsiteNero is highly optimized for learning various website developing technlogies. We try our best to add maximum modules and examples to help learn the concepts clearly and vividly. We try to present all content and examples as simple as we can removing any complexity to hurdle easy understanding. We try best provide you with worthful content, but we cannot guarantee full correctness of all the content on this site. While using this website, you agree to have read and accepted all our terms of use and conditions, cookie, and privacy policy. Copyright, 2013-2018 by websitenero.com. All Rights Reserved.