JSFiddle - React, Tailwind, and code Playground

by jfriend00

HTML

<div class="rep_td0 indent_4" id="title_1">Menu two</div>

CSS

.indent_2 {color:red;}

JavaScript

var o = document.getElementById("title_1");
o.className = o.className.replace(/\bindent_\d+\b/, "indent_2");