JSFiddle - React, Tailwind, and code Playground

HTML

Buy
<span class="closeform">
    <input type="text" name="eggs" onclick="window.showname(this);"/> 
 </span> 
    tomorrow.

CSS

.closeform{
    width: 70px;
}

.closeform input {
    width: 70px;
}

.closeform button {
    width: 70px;
}

JavaScript

window.showname = function (el) {
    el.value = el.name;
}