JSFiddle - React, Tailwind, and code Playground

by Mike_Bozhko

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<a id="font1" href="#" class="">BTN</a>

JavaScript

$("#font1").click(function() {
  $("#font1").toggleClass( "active" );
  
  if ($("#font1").hasClass('active')) {
	alert('Active');
} else {
	alert("Deative")
}
});