JSFiddle - React, Tailwind, and code Playground

by karthick6891

HTML

<!-- animate example-->
<div id="some"></div>

CSS

@keyframes fadeOut
{
  from { opacity: 1.0; }
  to { opacity: 0.0; }
}

@-webkit-keyframes fadeOut 
{
  from { opacity: 1.0 }
  to { opacity: 0.0 }
}

.fade-out
{ 
  animation: fadeOut 2s forwards;
  -webkit-animation: fadeOut 2s forwards;
}

#some{
    width:200px;
    height:200px;
    background-color:teal;
}

JavaScript

$("#some").on('click',function(){
    $(this).addClass("fade-out");
});