Hi folks

Just wondering if there's a quick/shorthand way of doing this:

I'm doing a navigation system where I want clickable items but I want to put the "current item number" in a footer, e.g.

Any ideas of a quick way (without using each) to get "CURRENTSTEPNUMBER" ? Basically the reverse of nth-child ?

CODE OUTLINE (IF IT HELPS) :

<script>
$("#stepsList li").click(function() {
 // load stepContent  ===> not a problem

$("#stepFooter").html("Viewing step "+CURRENTSTEPNUMBER+" of "+$("#stepsList li").length);

})
</script>


<h1>STEPS TO BE COMPLETED</h1>
<ul id="stepsList">
<li>step one</li>
<li>step two</li>
</li>step three<li>
</ul>

<div id="stepContent">

<div id="stepFooter">
</div>
</div>

Reply via email to