Answer the question
In order to leave comments, you need to log in
How to perform a replacement using a regular expression and a counter?
I wanted to change the ID in the HTML file with the increase of each id by 1.
It needs to be like this id="table0", id="table1", id="table2"….
So I didn't find how to do it. I got out of the situation by inserting PHP code with a counter. (table<?=$count++?>).
How to do autocorrect with iterator?
Answer the question
In order to leave comments, you need to log in
On jquery:
var counter = 0;
$(elements).each(function () {
$(this).prop('id', 'table' + counter);
counter++;
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question