JSFiddle - React, Tailwind, and code Playground

by ShoeMaker

HTML

<input type="search" name="search" id="search">
<div id="here">
  div 1
</div>
<input type="find" name="find" id="find">
<div id="there">
  div 2
</div>

JavaScript

$( '#search' ).on( 'change', function(e) {
  $( '#here' ).text( $( '#search' ).val() );
  if ( $.trim( $( '#search' ).val() ).length == 0 ) {
    $( '#here' ).hide();
  } else {
    $( '#here' ).show();
  }
} );