JSFiddle - React, Tailwind, and code Playground
by Karan1412
HTML
<html>
<head>
<title>prevAll</title>
</head>
<body>
<div>
<p>This is paragraph element. This is colored.</p>
<div>This is div element.</div><br>
<span class="css">This is span elment.</span><br />
</div><br />
<input type="button" id="prevAll" value="prevAll" />
<input type="button" id="reset" value="Reset" onclick="location.reload()" />
</body>
</html>
CSS
.css
{
color:Aqua;
font-size:30px;
}
JavaScript
$(document).ready(function () {
$("#prevAll").click(function () {
$(".css").removeClass("css").prevAll().addClass("css");
});
});