JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dot-luv/jquery-ui.css">
<button>Test</button>

<div id="ur_messagebox">Hilo</div>

JavaScript

function display_message(msgType, message) {
  var mb = $('#ur_messagebox')
           .addClass(msgType === 'confirm' ? 'msg_confirm' : 'msg_error')
           .html(message)
           .stop(true, true).fadeIn();
    if(mb.data('delay')) clearTimeout(mb.data('delay'));
    mb.data('delay', setTimeout(function() { mb.fadeOut(1000); }, 5000));
}
$("button").click(function() {
    display_message('confirm', 'Hi There');
});