JSFiddle - React, Tailwind, and code Playground
HTML
<button id="bt">Click</button>
JavaScript
func_a = function(arg1) {
alert('call a '+ arg1);
};
func_b = function() {
alert('call b');
};
func_c = function() {
alert('call c');
};
var bt = document.getElementById('bt');
var n = "a";
bt.addEventListener("click",function(){
window["func_" + n]('arg1');
(n == 'a' || n=='c')?n = 'b':n = 'c';
});