$( "div" ).each(function(i) { // in here, 'this' can be used to refer to the current DOM // element, whereas 'i' contains the loop index });