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

jquery disable option by value

$("select option:contains('Value b')").attr("disabled","disabled");
Comment

jquery disable option by value

$("select option[value='"+ $variable + "']").attr('disabled', true); 
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

how to disable time option in select jquery

$('#fromtime').on('change', function(){
    var totimeValues = [];
    
    var fromTime = $(this).val();

    $('#totime option').filter(function() {
        return $(this).val() <= fromTime;
    }).prop('disabled', true);

    
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: vue3 header 
Javascript :: javascript icon 
Javascript :: Nuxt.js + Electron 
Javascript :: redux action creators 
Javascript :: useeffect componentdidmount 
Javascript :: stringy 
Javascript :: javasccript this.innerHTML 
Javascript :: vue v-for loop array 
Javascript :: Use the parseInt Function 
Javascript :: != javascript 
Javascript :: History push for redirecting to another page in react-router v6 
Javascript :: js insert 
Javascript :: how to compile javascript 
Javascript :: remove first character javascript 
Javascript :: todo list javascript 
Javascript :: chart.js on hover and onclick event 
Javascript :: How to filter data using javascript 
Javascript :: mock javascript function 
Javascript :: Do not use forEach with async-await 
Javascript :: sessionstorage in javascript 
Javascript :: array reduce javascript 
Javascript :: can we add string and int in javascript 
Javascript :: how to detect click outside input element javascript 
Javascript :: javascript json to string print 
Javascript :: solidity payable 
Javascript :: mongoose save return id 
Javascript :: How to make a toggle button in Angularjs 
Javascript :: javascript unicode 
Javascript :: javascript best online game engine 
Javascript :: how to add comment in javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =