Example of HTML select box with multiple selection - HTML CSS HTML

HTML CSS examples for HTML:Form

Description

Example of HTML select box with multiple selection

Demo Code

ResultView the demo in separate window

Press control or shift key on the keyboard while clicking on the other options to enable multiple selections.

<!DOCTYPE html>
<html lang="en">
 <head> 
  <title>Example of HTML select box with multiple selection</title> 
 </head> <!--from w ww  . j a  va 2  s . c  o m-->
 <body> 
  <form action=""> 
   <select multiple> 
       <optgroup label="Sports cars"> 
          <option value="ferrari">Ferrari</option> 
          <option value="lamborghini">Lamborghini</option> 
       </optgroup> 
       <optgroup label="Luxury cars"> 
          <option value="mercedes">Mercedes</option> 
          <option value="bentley">Bentley</option> 
       </optgroup> 
    </select> 
  </form> 
 </body>
</html>

Related Tutorials