JSFiddle - React, Tailwind, and code Playground

by Ilia Lesnykh

HTML

<p>delete others #1</p>
<p>delete others #2</p>
<p>delete others #3</p>

CSS

p { cursor: pointer; display: inline-block; padding: 5px 10px; }
p:hover { background-color: #ccc; }
.disabled { text-decoration: line-through; }

JavaScript

$('p').on('click', function() {
    $('p').removeClass('disabled').not(this).addClass('disabled');
});