JSFiddle - React, Tailwind, and code Playground

HTML

<div id="clicker">Click Here</div>

<div id="rotating"></div>

CSS

#clicker { width: 100px; height: 100px; background-color: Green; }

#rotating { width: 100px; height: 100px; background-color: Red; margin-top: 50px; 
-webkit-transition: all 0.3s ease-in-out;
  -moz-transition: all 0.3s ease-in-out;
  -o-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
}
.rotated { transform:rotate(25deg); -webkit-transform:rotate(25deg); -moz-transform:rotate(25deg); -o-transform:rotate(25deg); }

JavaScript

$(document).ready(function() {
    $('#clicker').click(function() {
        $('#rotating').toggleClass('rotated');
    });
});