How to hide optgroup/option elements?

I figured that this solution works fine for me: Make another select e.g. $(“#footer_canvas”).after(‘<select id=”parkingLot”></select>’); then hide it $(“#parkingLot”).hide(); When you want to ‘hide’ some optgroup, just ‘park’ it in this hidden select. $(‘#VehicleVehicleCategoryId optgroup[label=”kategorie L”]’).appendTo(“#parkingLot”); Same way you can make it visible. This is just the snippets of my solution, that works fine for … Read more

Selectable in HTML tag

I don’t think you can but you can easily reproduce the visual style with css and thus only have options in your select, so everything is selectable. .optionGroup { font-weight: bold; font-style: italic; } .optionChild { padding-left: 15px; } <select multiple=”multiple”> <option value=”0″ class=”optionGroup”>Parent Tag</option> <option value=”1″ class=”optionChild”>Child Tag</option> <option value=”2″ class=”optionChild”>Child Tag</option> </select> The … Read more

Nesting optgroups in a dropdownlist/select

The HTML spec here is really broken. It should allow nested optgroups and recommend user agents render them as nested menus. Instead, only one optgroup level is allowed. However, they do have to say the following on the subject: Note. Implementors are advised that future versions of HTML may extend the grouping mechanism to allow … Read more