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();
    });
    $('.editP').live('blur', function(){
        $(this).hide().prev('b.edit').html($(this).val()).show();
    });