I want to make Textarea Disable (Grayed out) in my JS Method
function myfun(status){
if(status=='Yes'){
    $('input[id$="txtareaID"]').attr('disabled','disabled'); 
}
The above code is not working for this.
I want to make Textarea Disable (Grayed out) in my JS Method
function myfun(status){
if(status=='Yes'){
    $('input[id$="txtareaID"]').attr('disabled','disabled'); 
}
The above code is not working for this.
 
    
     
    
    You should use prop instead of attr:
$('input[id$="txtareaID"]').prop('disabled', true); 
 
    
    If your selector is correct, than you need only to change attr to prop:
function myfun(status){
   if(status === 'Yes'){ // more suitable for comparing
       $('input[id$="txtareaID"]').prop('disabled',true); 
   }
}
Related post: Disable/enable an input with jQuery?
Considering textarea as
<textarea id='txt'>Something</textarea>
Using jQuery, you can achieve like this
$("#txt").attr('disabled', true);
Using plain javascript
document.getElementById("txt").disabled=true;
 
    
    Your problem is with CSS not JS. As far I can tell your code is working, but there's no way of changing this specific style. You could try workarounds: Change Font Color For Disabled Input
 
    
     
    
    <textarea> is what you should be looking for not the <input> tag with id = textareaid.
$('input[id$="txtareaID"]').attr('disabled','disabled');
change the above code to the below one and see the magic by clicking the link at the bottom.
$('textarea[id$="txtareaID"]').attr('disabled','disabled');
 
    
    none of the below answers worked. Then I found something amazing trick which solved my problem --- Here it is --- JUST REMOVE "input" word from that line in if block -
WORKED CODE :
function myfun(status){
if(status=='Yes'){
    $('[id$="txtareaID"]').attr('disabled','disabled'); 
}
Previous CODE :
 function myfun(status){
    if(status=='Yes'){
        $('input[id$="txtareaID"]').attr('disabled','disabled'); 
        $('input[id$="txtareaID"]').prop('disabled',true); //Didn't worked either
    }
