JSFiddle - React, Tailwind, and code Playground

HTML

<div id="testinfo">Click here</div>
<div id="updateinfo" style="display:none;"></div>

CSS

.error{ border:1px solid red;}

JavaScript

$("#testinfo").click(function() {
    showUpdateInfo('blah','error');
});

function showUpdateInfo(data,infotype) {
    
    $("#updateinfo").show().addClass(infotype).text(data).fadeOut(3500);

  };