[SalesForce] Jquery to disable textarea field not working – Load function

I have a textarea which i'm trying to disable using the below code via JQuery read function

jQuery( document ).ready( function(){
  jQuery( 'input[id$=oprm12]' ).prop('disabled', true);   //Works for text field
  jQuery( 'input[id$=oprprob]' ).prop('disabled', true);  //Does not works for text area
}

The function works for text field but not for textarea field. Any inputs on how to fix this please?

Best Answer

try with this

jQuery('input[id$=oprm12], textarea').attr('disabled','disabled');
jQuery('input[id$=oprprob], textarea').attr('disabled','disabled');

Above code make all the text area to disabled

-- So javascript solution

document.getElementById('{!$Component.oprm12}').disabled = 'disabled';
document.getElementById('{!$Component.oprprob}').disabled = 'disabled';

Tested with above code working for me