JSFiddle - React, Tailwind, and code Playground
by Abhinav S
HTML
<script src="https://code.jquery.com/color/jquery.color.plus-names-2.1.2.js"></script>
<div id="list2" onclick="changeCol();">
color
</div>
CSS
#list2{
width:200px;
height:50px;
border:1px solid #ccc;
background-color:#ccc;
text-align: center;
vertical-align: center;
cursor: pointer;
}
JavaScript
function changeCol(){
$("#list2").animate({
backgroundColor: "#8bed7e"
}, 500).animate({
backgroundColor: "#ccc"
}, 500);
}