I wanted a way to replace the numbered bullets in an ordered list with graphical equivalents. Here’s a succinct solution:
-
$(‘ol li’).each(function(i){
-
$(this).css(
-
{ "padding-left":"40px",
-
"list-style":"none",
-
"background":"url(/images/"+(i+1)+".png) no-repeat"}
-
);
-
});
From this:

To this:

Easy!