JSFiddle - React, Tailwind, and code Playground

by ponyspy

HTML

<div id="content"></div>

<a id="add-element" href="#">add new element</a>

CSS

@-webkit-keyframes yellow-fade {
   0% {background: yellow;}
   100% {background: none;}
}
@keyframes yellow-fade {
   0% {background: yellow;}
   100% {background: none;}
}

.highlight {
   -webkit-animation: yellow-fade 2s ease-in 1;
   animation: yellow-fade 2s ease-in 1;
}

JavaScript

$('#add-element').click(function() {
    
    var newElement = $('<div class="highlight">new element</div>');
    
    $('#content').append(newElement);
    
});