JSFiddle - React, Tailwind, and code Playground
by oduska
HTML
<div class="apple-language-switcher">
<p>
<button class="language-active">Canada (English)</button> /
<button>Français</button>
</p>
</div>
CSS
.apple-language-switcher button {
color: #187c41;
text-decoration: underline;
border: none;
background-color: transparent;
cursor: pointer;
}
.apple-language-switcher .language-active {
color: #212529;
text-decoration: none;
cursor: initial;
}
JavaScript
jQuery(document).ready(function($){
$('.apple-language-switcher button').on('click', function(){
$(this).addClass('language-active').siblings().removeClass('language-active');
});
});