<!DOCTYPE html>
<html>
<body>
<select size="6">
<option value="BMW">BMW</option>
<option value="Mercedes">Mercedes</option>
<optgroup id="myOptgroup" label="Swedish Cars" disabled>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="koenigsegg">Koenigsegg</option>
</optgroup>
</select>
<p>Click the button to find out if a group of options in the drop-down list are disabled.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myOptgroup").disabled;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>