<div class="wrapper">
  <div class="container">
    <input type="text" class="input" placeholder="Search">
    <div class="close-btn">&times;</div>
  </div>
</div>
*{
  margin: 0;
  padding: 0;
}

body{
  background: #c49cde;
  font-family: Roboto;
}

.wrapper{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
}

.container{
  position: relative;
  padding: 20px 50px;
}

.input{
  width: 350px;
  border: 3px solid #fff;
  background: transparent;
  padding: 15px 30px;
  border-radius: 50px;
  outline: none;
  font-size: 18px;
  color: #fff;
  font-weight: bold;
  letter-spacing: 1px;
}

::-webkit-input-placeholder { /* Chrome/Opera/Safari */
  color: #fff;
  font-family: Roboto;
  letter-spacing: 2px;
  text-transform: uppercase;
}
::-moz-placeholder { /* Firefox 19+ */
  color: #fff;
}
:-ms-input-placeholder { /* IE 10+ */
  color: #fff;
}

.close-btn{
  position: absolute;
  top: 27px;
  right: 80px;
  font-size: 35px;
  cursor: pointer;
  color: #fff;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.close-btn.active{
  opacity: 1;
  animation: animate 0.5s linear;
}

@keyframes animate{
  0%{
    transform: scale(1);
  }
  25%{
    transform: scale(1.2);
  }
  50%{
    transform: scale(1.5);
  }
  75%{
    transform: scale(1.2);
  }
  100%{
    transform: scale(1);
  }
}
$(".input").focus(function() {
  $(".close-btn").addClass("active");
});

$(".input").focusout(function() {
  $(".close-btn").removeClass("active");
  $(this).val("");
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js