JSFiddle - React, Tailwind, and code Playground

HTML

<span rel="confirm" targetpath="" dbid="">
    Confirm message...
</span>

JavaScript

$('span[rel="confirm"]').click( function() {
    $('.confirmbox').remove();

    targetpath = $(this).attr("targetpath");
    dbid = $(this).attr("dbid");

    $(this).after('<div><span class="closeout">X</span> &nbsp Are you sure you want to <a href="index.php?cmd=deletesample&id=' + dbid + '&filetarget=' + targetpath + '">delete?</a></div>');
    $('.confirmbox').show(200);
});

$('.closeout').live('click', function() {
    alert('hello');
    $('.confirmbox').css('background-color', 'green');
});