JSFiddle - React, Tailwind, and code Playground
HTML
<div class="toggle_button">
<a href="#" onClick="counter = counter + 1" id="toggle_value">Click me</a>
</div>
<div id='hiddendiv'>
<div id="step1" class="display">
<p>step 1 text</p>
</div>
<div id ="step2" class="display">
<p>step 2 text</p>
</div>
<div id="step3" class="display">
<p>step 3 text</p>
</div>
<div id ="step4" class="display">
<p>step 4 text</p>
</div>
<div id="step5" class="display">
<p>step 5 text</p>
</div>
<div id ="step6" class="display">
<p>step 6 text</p>
</div>
<div id="step7" class="display">
<p>step 7 text</p>
</div>
<div id ="step8" class="display">
<p>step 8 text</p>
</div>
<div id="step9" class="display">
<p>step 9 text</p>
</div>
<div id ="step10" class="display">
<p>step 10 text</p>
</div>
<div id="step11" class="display">
<p>step 11 text</p>
</div>
</div>
CSS
.display { display: none; }
JavaScript
var counter = 0;
$('html').addClass('js'); // prevent hiding divs on DOM ready from 'flashing'
$(function() {
$('#toggle_value').click(function() {
$('div','#hiddendiv')
// to stop current animations - clicking really fast could originally
// cause more than one div to show
.stop()
// hide all divs in the container
.hide()
// filter to only the div in questio
.filter( function() { return this.id == 'step' + counter; })
// show the div
.show()
// prevent default anchor click event
return false;
});
});