Let's look at the following code:
<ul>
<li>What is jQuery?</li>
<li>What is HTML?</li>
<li>What is CSS</li>
</ul>
What I want to be able to do is to append after each question (into another div) this kind of text: question 1/3, question 2/3 and question 3/3...
I know length()
calculates the total number of matched elements so that would give me the number "3" that goes after the "/" but how do I display the current question's number? I know it's something related to index()
but I am not sure on how to do this.
Thank you!