JSFiddle - React, Tailwind, and code Playground
HTML
<img class="header-logo" src="http://placekitten.com/160/50" />
<input id="header-search" type="text" />
CSS
.header-logo {
position: absolute;
width: 160px; height: 50px;
top: 30px; left: 50%;
margin-left: -80px;
z-index: 2;
}
#header-search {
position: absolute;
width: 155px; height: 45px;
top: 30px; left: 50%;
margin-left: -80px;
z-index: 1;
display: none;
}
JavaScript
$(document).ready(function() {
$('.header-logo').mouseenter(function() {
$('.header-logo').fadeOut();
$('#header-search').fadeIn();
});
$('#header-search').mouseleave(function() {
$('#header-search').fadeOut();
$('.header-logo').fadeIn();
});
});