html - How to change disabled option text color in the pull down list? -


how can change font color of disabled option in select menu? (not select itself, options in pull down menu) want because in chrome/safari there no difference between disabled/enabled options (see first picture). in ie difference somehow obvious. in firefox quite obvious.

below approach works in ff. how can in cross-browser manner? https://jsfiddle.net/6wazms1a/3/

html:

<select>     <!-- want change text color of 'disabled' in pull down list.  reason: make non-disabled options more prominent (like in ie , firefox) -->     <option disabled>disabled</option>      <option selected>enabled selected</option>     <option>other enabled</option>        <option>another enabled</option> </select> 

css:

option:disabled, option[disabled], option[disabled="disabled"] { color: #ccc; } 

so far results:

chrome/safari

bad. there no difference between enabled/disabled options. can hardly tell enabled , not.

firefox , ie (ok)

good. easy spot disabled options

$(selectobject)     .attr('disabled', 'disabled')     .css({         "color":"red",         "background-color":"white",         "border-style":"solid"     }); 

Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

http - Safari render HTML as received -