JSFiddle - React, Tailwind, and code Playground
HTML
<textarea id="my_ta_1">example 1</textarea>
<textarea id="my_ta_2">example 2</textarea>
<textarea id="my_ta_3">example 3</textarea>
<br />
<select>
<option value=1>One</option>
<option value=2>Two</option>
</select>
JavaScript
$(function(){
$('textarea[id^="my_ta_"]').prop('disabled', function(){
return $.trim(this.value.toLowerCase()) == 'example 2'
})
.on('change', function(){
var txt = $(this).val();
if(txt.match(/example 2/i)){
$(this).prop('disabled', 1);
}
else $(this).prop('disabled', 0);
});
// works on (re-enables) my_ta_2
$('select').on('change', function(){
var text1 = $(this).val();
$('#my_ta_2').val(text1).trigger('change');
});
});