JSFiddle - React, Tailwind, and code Playground

by hiral

HTML

<ul>
    <li><a class="content">hello</a></li>
</ul>

CSS

.content:before{content: "sth";}

JavaScript

$("ul li a").click(function(){
    $(this).toggleClass("content");
});