<!DOCTYPE html>
<html>
<body>
<select size="6">
<option value="BMW">宝马</option>
<option value="Mercedes">奔驰</option>
<optgroup id="myOptgroup" label="中国车" disabled>
<option value="BYD">比亚迪</option>
<option value="GWM">长城</option>
<option value="Geely">吉利</option>
</optgroup>
</select>
<p>单击该按钮可查看是否禁用了下拉列表中的一组选项。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myOptgroup").disabled;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>