0

I have a select list:

<select multiple="multiple">
<option value="1">Macrostructures</option>
<option value="2">Woven</option>
<option value="3">Mystic Bird</option>
</select>

Now when somepody selects an option the option has a blue background. I know want to change the background color.

I already tried:

select option:checked { background: #787878; }

But this doesn't work. How is the correct selector?

Regards

bodokaiser
  • 15,122
  • 22
  • 97
  • 140
  • It is duplicate of below http://stackoverflow.com/questions/2402146/html-select-selected-option-background-color-css-style Thanks, – ravi May 21 '12 at 11:40

1 Answers1

1

check this

$('select').change(function() {
$('option').css('background', 'none');
$('option:selected').css('backgroundColor', 'red');
}).change();