JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="tbTitle" value="Title" name="tbTitle">
<input type="text" id="tbTitle1" value="Title1" name="tbTitle">
<input type="text" id="tbTitle2" value="Title2" name="tbTitle">
JavaScript
var var1
$("input").focus(function() {
var1 = $(this).val()
if ( $(this).val()==var1) {
$(this).val('').css({'color': "#000", 'font-style': 'normal', 'font-weight': 'bold'});
}
$(this).css({'background-color':'#d7df23' });
});
$("input").blur(function() {
if ( $(this).attr("value")=="") {
$(this).val(var1).css({'color': "#666", 'font-style': 'italic', 'font-weight': 'normal'});
}
$(this).css({'background-color':'#EEEEEE' });
});