I have a div with the id ring-preview, it has a unspecifed number of img elements with the class stone-preview inside it.
div
ring-preview
img
stone-preview
$('#ring-preview img.stone-preview').each(function(idx, itm) { $(itm).rotate(stones[idx].stone_rotation); });