This, I'm sure is a pretty basic question about JavaScript, so apologies in advance.
I have simple unordered list:
<ul>
<li><a href="">Item number 1</a></li>
<li><a href="">Item number 2</a></li>
<li><a href="">Item number 3</a></li>
<li><a href="">Item number 4</a></li>
<li><a href="">Item number 5</a></li>
</ul>
How would I be able to prepend an incremental number to those 5 items, so I get:
<ul>
<li><span>1</span><a href="">Item number 1</a></li>
<li><span>2</span><a href="">Item number 2</a></li>
<li><span>3</span><a href="">Item number 3</a></li>
<li><span>4</span><a href="">Item number 4</a></li>
<li><span>5</span><a href="">Item number 5</a></li>
</ul>
The logic behind the increment variable is getting me.