JSFiddle - React, Tailwind, and code Playground

by Ravichandra Thota

HTML

<input type="button" id="yy" value="click me">
<img class="north" src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSGPgQ8k88yaWVPRytT957hKLV-89QmZtkZc44q45TEDdqe9sKwqg">
    <input type="button" id="xx" value="click me">

CSS

.north {
transform:rotate(0deg);
-ms-transform:rotate(0deg); /* IE 9 */
-webkit-transform:rotate(0deg); /* Safari and Chrome */
}

JavaScript

var count=90;
$('#xx').click(function(){
    $('img').css('transform','rotate('+count+'deg)');
   count=count+90;
});
$('#yy').click(function(){
    count=count-90;
    $('img').css('transform','rotate('+count+'deg)');   
});