A
A
Alexander Donov2015-09-24 20:01:55
css
Alexander Donov, 2015-09-24 20:01:55

How to change the color of an option select?

When publishing select, the first option has the value "----" (generated automatically) I
changed the value with this script, but it differs in shade from the input placeholder above.

$('#sf1442558131n option:contains("----")').text('Район');

Tried with a script
$('#sf1442558131n option:contains("Район")').css('color', '#ccc');

but it only changes the color of the option when the list is dropped.
How to change the color of the default select value?
2c442e1e4ffd42239181baa0ea4da661.PNGe9e87c5316ff44a2b14e03c881462d7f.PNG

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
littleguga, 2015-09-24
@littleguga

Everything should work, see if any other style overlaps.
Here is your working code
ps
What an interesting message board you have

V
Vitaly Inchin ☢, 2015-09-24
@In4in

False in both cases. We need to change the color of the text only for "Region", that is, to create the illusion of a placeholder.
The remaining options do not change color.

It's all right?

A
Alexander Donov, 2015-09-25
@web-54

Неверно в обоих случаях. Нужно изменить цвет текста только для "Район", то есть создать иллюзию placeholder.
Остальные option цвет не меняют.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question