JSFiddle - React, Tailwind, and code Playground

by sushanth009

HTML

<div class="info" id="step1">
<a href="#" id="next_step_1"> ok </a>

</div>
<div class="info" id="step2">
<a href="#" id="next_step_2"> ok </a>

</div>
<div class="info" id="step3">
<a href="#" id="next_step_3"> ok </a>

</div>

JavaScript

for (var i = 1; i < 5; i++) {
    $("body").delegate('#next_step_' + i, 'click', bindClick(i));
}

function bindClick(i) {
    return function() {
        alert("#step"+i)
    }
}