Posted By

davebowker on 02/10/09


Tagged

class jquery counter sequential


Versions (?)

jQuery Sequential List


 / Published in: JavaScript
 

  1. $("#step li").each(function (i) {
  2. i = i+1;
  3. $(this).addClass("item" i);
  4. });
  5.  
  6. -- Alt
  7.  
  8. $("#step li").each(function (i) {
  9. $(this).addClass("item" + (++i));
  10. });
  11.  
  12.  
  13. $("#commentlist li").each(function (i) {
  14. i = i+1;
  15. $(this).prepend('<span class="commentnumber"> #' i '</span>');
  16. });

Report this snippet  

You need to login to post a comment.