Created
March 11, 2014 20:17
-
-
Save dompascal/9494104 to your computer and use it in GitHub Desktop.
JS - Add sequential numbers to each item
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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