Example of HTML optgroup tag, group options in select tag - HTML CSS HTML

HTML CSS examples for HTML:Form

Description

Example of HTML optgroup tag, group options in select tag

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html lang="en">
 <head> 
  <title>Example of HTML optgroup tag</title> 
 </head> <!--  ww  w.  java2 s  .  c  o m-->
 <body> 
  <form> 
   <select> 
      <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