JSFiddle - React, Tailwind, and code Playground
HTML
<input type="button" id="new" value="ajout" />
JavaScript
$('#new').click(function(){
newdiv=$('<div>');
newspan=$('<span/>').html('delete me').css('margin','10px').addClass('deleteit');
newdiv.append(newspan);
$('body').append(newdiv);
})
$('div span.deleteit').on('click',function(){
$(this).parent().remove();
})