JSFiddle - React, Tailwind, and code Playground

HTML

<textarea></textarea>

JavaScript

$("textarea").on('input propertychange', function() {
    if ($(this).val() == "") {
        $(this).css("background-color", "#f00");
    }
});