JSFiddle - React, Tailwind, and code Playground
by stackmanoz
HTML
<input type="text" id="inputtext">
<div class="tag"></div>
CSS
.tag
{
height:auto;
width:auto;
background:green;
color:white;
text-align:center;
display:none;
position:absolute;
padding:5px;
margin:1em;
}
JavaScript
$(function(){
$("#inputtext").keypress(function(e){
var valueofinput= $(this).val();
if(e.which==13)
{
$('.tag').html(valueofinput);
$('.tag').show();
}
});
$('.tag').click(function(){
$(this).hide();
});
});