JSFiddle - React, Tailwind, and code Playground
HTML
<!doctype html>
<html>
<head>
<style>
.container {
width: 200px;
height: 400px;
border: 5px solid;
border-bottom-color: blue;
border-top-color: red;
}
</style>
</head>
<body>
<div class="container" id="container" onclick="rotate()"></div>
<script>
var degrees = 0;
function rotate() {
if(degrees == 180){
document.getElementById("container").style.transform =
"rotate(360deg)";
degrees= 0;
}else{
document.getElementById("container").style.transform =
"rotate(180deg)";
degrees= 180;
}
}
</script>
</body></html>