JSFiddle - React, Tailwind, and code Playground

by DannyEnglander

HTML

<input type="text" id="edit-search" name="search" value="Search" size="30" maxlength="128" class="form-text">

JavaScript

var defaultText = $('input[type=text]').val();
    $('input[type=text]').focus(function() {
      $(this).val('');
      });
     $('input[type=text]').blur(function() {
      $(this).val(defaultText); // fixed!
      });