JSFiddle - React, Tailwind, and code Playground

HTML

<label for="name">Name:
    <input type="text" id="name" name="name">
</label>
    
<label for="nickname">Nickname:
    <input type="text" id="nickname" name="nickname">
</label>
<br/>

JavaScript

$(function(){
    
    $("input[id='name']").click(function(){
        
        $(this).parent().contents().filter(function(){
            return this.nodeType === 3;
        }).remove();
       
        $(this).parent().prepend("SuperName:");
    });
    
    
});