JSFiddle - React, Tailwind, and code Playground

HTML

<p class="class">
  <a href="http://hashcode.ru/" class="active">Ссылка 1</a>
  <a href="http://hashcode.ru/3">Ссылка 2</a>
  <a href="http://hashcode.ru/1">Ссылка 3</a>
  <a href="http://hashcode.ru/2">Ссылка 4</a>
</p>
<button>Тыркалка</button>

CSS

a {
  color: black;
}

.active {
  color: green;
}

JavaScript

$('button').click(function() {
  $('.class .active').removeClass('active')
    .next().addClass('active');
});