JSFiddle - React, Tailwind, and code Playground
HTML
<textarea></textarea>
JavaScript
$("textarea").on('input propertychange', function() {
if ($(this).val() == "") {
$(this).css("background-color", "#f00");
}
});
<textarea></textarea>
$("textarea").on('input propertychange', function() {
if ($(this).val() == "") {
$(this).css("background-color", "#f00");
}
});