JSFiddle - React, Tailwind, and code Playground
by Mohit Kumar Gupta
HTML
<input type="text" value="" alt="mohit"/><br/>
<input type="text" value="mohit" alt="mohit"/><br/>
JavaScript
$( "input, select" ).each(function( i ) {
var tooltipVal = $(this).attr("alt").trim();
var inputVal = $(this).val().trim();
//console.log("tooltipVal : "+ tooltipVal +" inputVal :"+ inputVal);
if(inputVal == inputVal){
inputVal= $(this).val("");
}
console.log("tooltipVal : "+ tooltipVal +" inputVal :"+ inputVal);
});