The disable attribute in option tag not working
Posted: 26 Oct 2020, 06:12
I have designed a html page, but in option tag I have set disabled="true", still it is not disabling the option.
Things I have tried:
And in JS with jQuery:
Here is my html code:
Is there any other way to disable those options?
Things I have tried:
Code: Select all
disabled="true"
disabled="disabled"
Code: Select all
$(".dis").prop("disabled", true);
Code: Select all
<select name="selectcountry1" id="c1">
<option value="select" class="dis" disabled="true" selected>Select Country 1</option>
<option value="India">India</option>
<option value="Australia">Australia</option>
<option value="England">England</option>
<option value="NewZealand">New Zealand</option>
<option value="SouthAfrika">South Afrika</option>
<option value="WestIndies">West Indies</option>
<option value="Pakistan">Pakistan</option>
<option value="SriLanka">Sri Lanka</option>
<option value="Bangladesh">Bangladesh</option>
<option value="Afganistan">Afganistan</option>
</select>