Following is my code which is working fine in Firefox 68.0.2 but not on Chrome 76 and Safari 12.1.2. Let me know a workaround or what I am doing wrong here.
I want to make the first select option as gray and rest of the option as black.
Code -
$(document).ready(function(){
$("select").change(function(){
if ($(this).val()=="") $(this).css({color: "#aaa"});
else $(this).css({color: "#000"});
});
});
select{
color:#aaa;
}
option:not(first-child) {
color: #000;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select>
<option value="">Please select and option</option>
<option>#1</option>
<option>#2</option>
<option>#3</option>
<option>#4</option>
</select>