Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery disable select

$('#pizza_kind').prop('disabled', false);
Comment

disable option dropdown jquery

//disable by value
$("#ddlList option[value='jquery']").attr("disabled","disabled");

//disable by text
$('#ddlList option:contains("HTML")').attr("disabled","disabled");
Comment

how to disable option after select using jquery

//JS
$("#theSelect").change(function(){          
  var value = $("#theSelect option:selected").val();
  var theDiv = $(".is" + value);

  theDiv.slideDown().removeClass("hidden");
});


$("div a.remove").click(function () {     
  $(this).parent().slideUp(function() { $(this).addClass("hidden"); }); 
});

//HTML
<body>
<div class="selectContainer">
    <select id="theSelect">
        <option value="">- Select -</option>
        <option value="Patient">Patient</option>
        <option value="Physician">Physician</option>
        <option value="Nurse">Nurse</option>
    </select>
</div>
<div class="hidden isPatient">Patient <a href="#" class="remove" rel="Patient">remove</a></div>
<div class="hidden isPhysician">Physician <a href="#" class="remove" rel="Patient">remove</a></div>
<div class="hidden isNurse">Nurse <a href="#" class="remove" rel="Patient">remove</a></div>
</body>​
Comment

PREVIOUS NEXT
Code Example
Javascript :: yarn react-native-async-storage 
Javascript :: javascript emit beep 
Javascript :: next js active link 
Javascript :: protractor move mouse and click 
Javascript :: angular form set value without fire event 
Javascript :: jquery each data 
Javascript :: react copy to clipboard 
Javascript :: get link js 
Javascript :: box shadow javascript style change 
Javascript :: how to get random colors in js 
Javascript :: pyspark dataframe json string 
Javascript :: $ is not defined 
Javascript :: how to check if 2 sprites are touching js 
Javascript :: hello world expressjs 
Javascript :: elixir file open and parse json 
Javascript :: Get Substring between two characters using javascript 
Javascript :: laravel variable in javascript 
Javascript :: js tolocalestring with hours 
Javascript :: update nodejs mac 
Javascript :: change onclick attribute javascript 
Javascript :: update to angular 12 
Javascript :: Data path "" should NOT have additional properties(es5BrowserSupport 
Javascript :: reversing an array in js 
Javascript :: web3 check if contract 
Javascript :: jquery hover function 
Javascript :: javascript current time 
Javascript :: #react native shadow 
Javascript :: js does array.map maintain the order 
Javascript :: rotate div javascript 
Javascript :: an image gallery is a set of images with corresponding remove buttons 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =