Skip to content

Instantly share code, notes, and snippets.

@dompascal
Created March 11, 2014 20:17
Show Gist options
  • Save dompascal/9494104 to your computer and use it in GitHub Desktop.
Save dompascal/9494104 to your computer and use it in GitHub Desktop.
JS - Add sequential numbers to each item
// add sequential numbers to each list item
$("ol#boutiques li .city-and-state").each(function (i) {
i = i+1;
if(i < 10) i = "0"+i;
$(this).prepend('<span class="number">' +i+ '.</span>');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment