JSFiddle - React, Tailwind, and code Playground

by bryangrimes

HTML

<div>
    <input type="text" title="Tittle" value=""/>
    <label>
    </label>
</div>
<div>
    <input type="text" title="Name" value=""/>
    <label>
    </label>
</div>
<div>
    <input type="text" title="Address" value=""/>
    <label>
    </label>
</div>

JavaScript

$('input:text').focus(function () {
   // clean label
   $('input:text').next('label').html("");
    
   // get input title
   var title = $(this).attr('title');            
   
   // add html to label from input title
   $(this).next('label').html("<h1>cool bro</h1>");
});