Is there a way to hide option
or optgroup
HTML elements? I\'ve tried calling hide()
in jQuery, and also using regular Javascript to se
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 me.