JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" name="s" id="search" value="Search for post">
JavaScript
$('#search').focus(function() {
if($(this).val() == 'Search for post'){
$(this).val('');
}else
{
$(this).val('dsfsdf');
}
});