JSFiddle - React, Tailwind, and code Playground
HTML
<button type="button" class="btn" name="showAllBtn">Show all</button>
JavaScript
document.querySelector("button[name='showAllBtn']").addEventListener("click",function(){
var state = this.dataset.clicked;
state = typeof state == "undefined" ? "Y" : state;
((state == "Y") ? showAllSteps : nextStep)();
this.dataset.clicked = (state == "Y") ? "N" : "Y";
},false);
function showAllSteps(){
alert("showAllSteps");
}
function nextStep(){
alert("nextStep");
}