JSFiddle - React, Tailwind, and code Playground

by Sparrow Squire

HTML

<span id="active">button click...</span>
<span id="active2">xsadsdsk...</span>
<div></div>

CSS

div {
margin: 3px;
width: 40px;
height: 40px;
position: absolute;
left: 0px;
top: 30px;
background: green;
display: none;
}
div.newcolor {
background: blue;
}
#active2 {display:none;}

JavaScript

$('#active').click(function() {
   /* $('#active').slideToggle();
    $( "div" ).slideToggle()
              .animate({ left: "+=200" }, 2000 )
              .queue(function() {
                    $( this ).addClass( "newcolor" ).dequeue();
              })
              .animate({ left: "-=200" }, 500 )
              .queue(function() {
                    $( this ).removeClass( "newcolor" ).dequeue();
              })
              .slideUp();*/
    
$("#active").hide();
$("#active2").show();

});