JSFiddle - React, Tailwind, and code Playground
HTML
<b class = "edit" id = "fooo"> FOO </b>
JavaScript
$('b.edit').click(function(){
$(this).hide().after('<form action = "foo.php" method = post><input hidden name = "field" type = "text" value = "'+this.id+'"/><input type="text" name = "period" class="editP" value="'+$(this).html()+'" /><input type = "submit" value = "Submit!!" /></form>');
$('.editP').focus();
$('.input[type=submit]').click(function(){
$(this).prev().hide();
});
});