JSFiddle - React, Tailwind, and code Playground
HTML
<ul>
<li>1. Some text</li>
<li>2. Some text</li>
<li>3. Some text</li>
<li>4. Some text</li>
</ul>
CSS
li:first-letter {
color:blue;
}
.selected {
background-color:#eee;
}
.selected:first-letter {
color:inherit;
}
JavaScript
$('li').click(function () {
$('li.selected').removeClass('selected');
$(this).toggleClass('selected');
});