Questions tagged [optgroup]

The OPTGROUP element defines a group of choices within a SELECT menu.

The OPTGROUP element defines a group of choices within a SELECT menu. OPTGROUP must contain one or more OPTION elements to define the actual choice

Example:

<select>
  <optgroup label="Swedish Cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
  </optgroup>
  <optgroup label="German Cars">
    <option value="mercedes">Mercedes</option>
    <option value="audi">Audi</option>
  </optgroup>
</select> 

sources: http://htmlhelp.com/reference/html40/forms/optgroup.html, http://www.w3schools.com/tags/tag_optgroup.asp

259 questions
-1
votes
1 answer

How to remove optgroup while leaving options

Can anyone please explain why jQuery works on the original code but deletes all the option for my code. var i=0; var cursel = "#mySelect".concat(i); $(cursel).children().remove("optgroup"); Original Code: http://jsfiddle.net/frJEq/ My…
-2
votes
1 answer

Dynamic accordion style checkbox menu in angular

I want to create a select menu with dynamic accordion style checkbox options same as the picture below: or like this: My data looks like this: let allowedShifts = [{ category: "Days", name: "D" }, { category: "Evenings", name:…
Suleman Mirza
  • 905
  • 1
  • 12
  • 22
-13
votes
2 answers

Requesting content without reloading the page

I want to use a select element for mobile viewing of my website. Following is the select options. HTML: