select向下箭头隐藏方法:
css{
appearance:none;
-moz-appearance:none;
-webkit-appearance:none;
-ms-appearance:none;
}
先清除默认样式,再使用span标签去代替下拉箭头样式。
在IE下隐藏下来箭头
css{
select::-ms-expand { display: none; };
}
使用JS切换选中状态文字颜色与默认状态下文字颜色。
// select 默认颜色与选中颜色切换
$('select').css('color','#999');
$('option').css('color','#323232');
$('select').change(function(){
var $selltem = $(this).val();
if($selltem == $(this).find('option:first').val()){
$(this).css('color','#999');
}else{
$(this).css('color','#323232');
}
});