JSFiddle - React, Tailwind, and code Playground

by SergPolozov

HTML

<form>
    <input type="text" value="поиск">
    <button type="submit">Поиск</button>
</form>

JavaScript

$('input').data('def', 'поиск');
$('input').on('focus', function(){
    if ($(this).val() == $(this).data('def')) 
        $(this).val('');
});

$('input').on('blur', function(){
    if ($(this).val() == '') 
        $(this).val($('input').data('def'));
});