用optgroup 禁用select中的option方法

<html>
<head>
<style type="text/css">
.disabled {
}
.disabled optgroup{
font-size: 12px;
font-style: normal;
font-weight: normal;
font-variant: normal;
color:#CCCCCC;
background-color: #F5F5F5;
}
.disabled option {
padding-left:0px;
}
</style>
<title></title>
</head>
<body>
<select name="carCos" class="disabled">
<optgroup label="American"></optgroup>
<option value="General Motors">General Motors</option>
<option value="Ford">Ford Motor Company</option>
<option value="Chrysler">DaimlerChrysler</option>
<optgroup label="Japanese"> </optgroup>
</select><br>
用这种变态的方式可以实现,在firefox和ie6下看效果很好
</body>
</html>

你可能感兴趣的:(select)