JSFiddle - React, Tailwind, and code Playground

by josangel555

HTML

<span class="border x">Helooooooooooooo</span>
<span class="y">Helooooooooooooo</span>

CSS

.border{
    border: 1px solid red;
}

span{
    cursor: pointer;
}

JavaScript

$(".x").on("click",function(e){
    $(".y").click();
});

$(".y").on("click",function(e){
    $(".y").toggleClass("border");
});