Styles on optgroup

How can you put a style in optgroup in a select tag?

http://jsfiddle.net/UCNJ8/3/

JS:

$('<select></select>').appendTo('body').append('<option value="0">test</option>') .append($('<optgroup label="group"></optgroup>') .append('<option value="1">group test</option>')); 

CSS

 select.optgroup[label] { font-style:normal; } 
+4
source share
1 answer

Instead, use the CSS select optgroup .

Remember that not every browser will abide by optgroup rules (e.g. Webkit). With that in mind, you might like to try the jQuery plugin, which allows you to do a full, cross-look at the styles of form elements; e.g. Uniform .

+5
source

All Articles