JSFiddle - React, Tailwind, and code Playground

by Gaurav Singh

HTML

<button class="showMsg">Click Me</button>
<div id="display-success">The error Message</div>

CSS

#display-success {
    display:none;
    color:red;
}

JavaScript

$(".showMsg").click(function () {
    $('#display-success').fadeIn().delay(3000).fadeOut();
});