JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://raw.github.com/louisremi/jquery.transform.js/master/jquery.transform.light.js"></script>
<button id="m1">-1 deg</button>
<button id="p1">+1 deg</button>
<div id='box' class='box'></div>

CSS

.box {position: absolute; width:300px; height: 300px; border: 1px black solid; top: 100px;}

JavaScript

var b=$('#box');

$('#m1').click( function () { rotateby(-1); });
$('#p1').click( function () { rotateby(1); });


function rotateby(x) {
    var r=$.transform.radToDeg(
        b.css('transform').rotate
    );
    r+=x;
    b.css('transform',"rotate("+r+"deg)");    
}