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 :: javascript sum array values by key 
Javascript :: javascript detect ios device 
Javascript :: js event listener url change 
Javascript :: express server how to get request ip 
Javascript :: play background music in html jasvascript 
Javascript :: window viewport size javascript 
Javascript :: Error: Material-UI: The data grid component requires all rows to have a unique id property. 
Javascript :: js random id 
Javascript :: jqiery call onclick in another element 
Javascript :: clear async storage react native 
Javascript :: js tolocalestring without seconds 
Javascript :: creating new react app 
Javascript :: newtonsoft json change property name 
Javascript :: how to see if user clicked key in js 
Javascript :: enter event in jquery 
Javascript :: javascript-find-json-value 
Javascript :: jquery empty file input 
Javascript :: how to check wether the property exist in a object in java script 
Javascript :: vimeo id regex 
Javascript :: mongodb nodejs connect localhost 
Javascript :: javascript foreach key value 
Javascript :: react router how to go back 
Javascript :: javascript byte array to hex string 
Javascript :: how to wait foreach javascript 
Javascript :: discord embed image with file discord js 
Javascript :: array contains case insensitive javascript 
Javascript :: track window size jquery 
Javascript :: jquery reset select2 
Javascript :: get variable name javascript 
Javascript :: credit card regex javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =