<div class="box"></div>
.box {
  background-color: #fe83ff;
  width: 100px;
  height: 100px;
  transition: 2s all ease-in-out 0.2s;
}

.blue {
  background-color: #27b3f9;
  width: 200px;
  height: 100px;
}
$('.box').on('click', function(){
  $(this).toggleClass('blue');
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

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