/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$("#step li").each(function (i) { i = i+1; $(this).addClass("item" i); }); -- Alt $("#step li").each(function (i) { $(this).addClass("item" + (++i)); }); $("#commentlist li").each(function (i) { i = i+1; $(this).prepend('<span class="commentnumber"> #' i '</span>'); });