1//disable by value
2$("#ddlList option[value='jquery']").attr("disabled","disabled");
3
4//disable by text
5$('#ddlList option:contains("HTML")').attr("disabled","disabled");
1//JS
2$("#theSelect").change(function(){
3 var value = $("#theSelect option:selected").val();
4 var theDiv = $(".is" + value);
5
6 theDiv.slideDown().removeClass("hidden");
7});
8
9
10$("div a.remove").click(function () {
11 $(this).parent().slideUp(function() { $(this).addClass("hidden"); });
12});
13
14//HTML
15<body>
16<div class="selectContainer">
17 <select id="theSelect">
18 <option value="">- Select -</option>
19 <option value="Patient">Patient</option>
20 <option value="Physician">Physician</option>
21 <option value="Nurse">Nurse</option>
22 </select>
23</div>
24<div class="hidden isPatient">Patient <a href="#" class="remove" rel="Patient">remove</a></div>
25<div class="hidden isPhysician">Physician <a href="#" class="remove" rel="Patient">remove</a></div>
26<div class="hidden isNurse">Nurse <a href="#" class="remove" rel="Patient">remove</a></div>
27</body>