How to make Multiple selection in dropdownlist in HTML

In this article we will discuss about how to select multiple options in the dropdownlist in HTML.
  • 1990

If we want to make the dropdownlist in such a way as to select multiple options at once. Basically we can select only one option at a time in the dropdownlist but if we want we to select multiple options at once we can set its multiple attribute.

HTML Code:

<html>

<body bgcolor="silver">

    <select multiple="multiple" height="78%">

        <option value="select">--select--</option>

        <option value="red">red</option>

        <option value="orange">orange</option>

        <option value="yellow">yellow</option>

        <option value="white">white</option>

        <option value="grey">grey</option>

        <option value="pink">pink</option>

        <option value="purple">purple</option>

        <option value="voilet">voilet</option>

        <option value="blue">blue</option>

    </select>

</body>

</html>

Output:

 selectt.jpg

In the above output we have seen that we can select multiple options at once in the dropdownlist and also its appearance has been changed.

Ask Your Question 
 
Got a programming related question? You may want to post your question here
 

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.