 at work this past week a client requested something that i wasnt sure how to achieve a reversed ordered list so basically they wanted to have a top 10 list with the first item being numbered 10 and the last 1 if you want to skip ahead to the demo go ahead view demo now sure i could have just written the numbers in as text but its a list and its ordered here is an example of what the client wanted 10 lorem ipsum dolor sit amet consectetur adipiscing elit 9 lorem ipsum dolor sit amet consectetur adipiscing elit 8 lorem ipsum dolor sit amet consectetur adipiscing elit 1 lorem ipsum dolor sit amet consectetur adipiscing elit after some digging around i found out that you can add the value attribute to each list item to specify the number to display so basically i just needed to code my list like this ol li value= 10 lorem ipsum dolor sit amet consectetur adipiscing elit li li value= 9 lorem ipsum dolor sit amet consectetur adipiscing elit li li value= 8 lorem ipsum dolor sit amet consectetur adipiscing elit li hellip li value= 1 lorem ipsum dolor sit amet consectetur adipiscing elit li ol pretty straightforward but also pretty ugly so what happens when the client decides they want to insert another bullet in the middle of the list yep thats right they would have to adjust the numbering for the rest of the list pretty crappy so lets use the powerfulness of jquery to make this a little better the markup so just like before we just want to create an ordered list but this time we will leave off the value attribute we are also going to add a class to the ordered list that we will use as a hook to add in the jquery functionality ol class= reversed lilorem ipsum dolor sit amet consectetur adipiscing elit li lilorem ipsum dolor sit amet consectetur adipiscing elit li lilorem ipsum dolor sit amet consectetur adipiscing elit li hellip lilorem ipsum dolor sit amet consectetur adipiscing elit li ol the jquery mapping out the code a bit we want to select each element with a class of reversed and count the total number of children list items then we want to loop through the children and update the value attribute to be the value of the total number of children minus a counter variable that we started at zero and increment each time through the loop that seems relatively straightforward so ill just show the code that i wrote $ document ready function $ reversed each function var $children = $ this children li var totalchildren = $children length var start = 0 $children each function $ this val totalchildren start start view demo it looks like with html 5 we get a reversed attribute that accomplishes the same thing but until its fully supported this quick easy solution seems to work on a personal note i have been severely neglecting my blog but for good reason i have been teaching some intro to web development courses at cdiabu in georgetown also i will be starting a new job on december 1st i will be joining the amazing team at viget labs as their new front end developer 