<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>
</html>