<html>
<body>
<select id="pets" size="3">
<option>Cat</option>
<option>Dog</option>
<option>Horse</option>
</select>
<p>Click the button to disable the third option (index 2) in the dropdown list.</p>
<button onclick="myFunction()">Disable Option</button>
<script>
function myFunction() {
var x = document.getElementById("pets").options[2].disabled = true;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_option_disabled2 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 14:47:52 GMT -->
</html>