Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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

PREVIOUS NEXT
Code Example
Javascript :: get element by multiple class javascript 
Javascript :: how to see chrome sync storage and local storage 
Javascript :: javascript transpose array 
Javascript :: js get svg width 
Javascript :: add variables in javascript 
Javascript :: javascript send post 
Javascript :: javascript game loop 
Javascript :: detect system dark mode javascrip 
Javascript :: How to insert divider in react native 
Javascript :: router navigatebyurl 
Javascript :: difference between backtick and quotes 
Javascript :: shadow in react native 
Javascript :: jquery add element to array 
Javascript :: un hover in jquery 
Javascript :: convert milliseconds to minutes and seconds javascript 
Javascript :: chartjs stacked bar show total 
Javascript :: how to run different node app on server different domains 
Javascript :: jwt token expire times 
Javascript :: jquery download image from url 
Javascript :: update nodejs ubuntu 
Javascript :: javascript key pressed enter 
Javascript :: string replace javascript 
Javascript :: roblox headshot image js 
Javascript :: xhr 
Javascript :: remove axis tick ends d3 
Javascript :: string to binary javascript 
Javascript :: google script wait 
Javascript :: javascript check if json file is empty 
Javascript :: javascript date get future 15 minutes 
Javascript :: how to check if a folder exist if not then create nodejs 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =