JSFiddle - React, Tailwind, and code Playground
by der_robert
HTML
<div class="alert alert-success" data-remove="5">
<h4>Aktivieren Erfolgreich.</h4>
<p>Du kannst dich jetzt einloggen.</p>
</div>
JavaScript
$(document).each("[data-remove]",function() {
var s = $(this).data("remove")* 1000;
var el = $(this);
console.log(this);
setTimeout(function(){
el.hide(0);
el.addClass("hidden");
console.log("weg");
},s);
});