JSFiddle - React, Tailwind, and code Playground
HTML
<div id="btn-group" style="width:100%">
<a href="#Home" style="width:10%" class="button">home</a>
<a href="#Hobbies" style="width:10%" class="button">Hobbies</a>
<a href="#contact_us " style="width:10%" class="button">Contact</a>
<a href="#services" style="width:10%" class="button">Services</a>
<a href="#surprise"></a>
</div>
CSS
.active {
background-color: #f06f06;
}
JavaScript
$("#btn-group .button").click(function(){
$("#btn-group .button").removeClass('active');
$(this).toggleClass('active');
});