internet explorer - CSS: Remove gray highlight on a default option in a select element -


this problem happens on ie, tested ie11.

in order hide placeholder in browser, except ie, display none job. ie solution lit bit more elaborated. idea make default option disabled, user can't click on placeholder.

so far good, here comes problem now:

enter image description here

this shadow + highlight in gray not desired.

how reproduce (please use ie...)

  1. jsfiddle: http://jsfiddle.net/lcustodio/u8ng9ybf/4/

  2. stack snippet:

.default-option {    display: none;  }  select::-ms-value {    background: none;    color: #42413d;  }
<select>    <option disabled selected class='default-option'>select...</option>    <option>hello</option>    <option>world</option>  </select>

*ps: remove blue highlight on selected option based on hint. refer css on fiddle well.

i'm not sure can done css, can try

example : jsfiddle

a little js

$(function() {   $('select').change(function() {     $('select option.default-option').remove();   }); }); 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -