JSFiddle - React, Tailwind, and code Playground
HTML
<div id="row_1">
<p class="first">first_1</p>
<p class="first">first_2</p>
<p class="first">first_3</p>
<p class="first">first_4</p>
<p class="first">first_5</p>
</div>
CSS
#row_1 .first:hover {
background-color: #ddd;
}
.blueBg {
background-color: blue;
}
.greyBg{
background-color: #ddd;
}
JavaScript
$('.first').click(function() {
$('.blueBg').removeClass('blueBg');
$(this).addClass('greyBg');
$('.first').not(this).addClass('blueBg');
});