JSFiddle - React, Tailwind, and code Playground
HTML
<div class="ativo3 and many other classes"></div>
<div class="another classes here with ativo1"></div>
<div class="here ativo9 and more two or three"></div>
CSS
div {
background-color: #ddd;
height: 50px;
width: 50px;
display: inline-block;
margin: 10px;
cursor: pointer;
}
JavaScript
$("div[class^='ativo']").on("click", function(){
$(this).removeClass("^='ativo'");
});