How to Disable DropDown List Item using jQuery
//Code Starts
$(document).ready(function() {
$("#ddlList option[value='jquery']").attr("disabled","disabled");
});
//Code Ends
You can also disable item by their Text, not by value. Below jQuery code will disable the List Item with text "HTML"
//Code Starts
$(document).ready(function() {
$('#ddlList option:contains("HTML")').attr("disabled","disabled");
});
//Code Ends
Comments
Post a Comment