<--- --------------------------------------------------------------------------------------- ---- Blog Entry: The Beauty Of The jQuery Each() Method Author: Ben Nadel / Kinky Solutions Link: http://www.bennadel.com/index.cfm?dax=blog:534.view Date Posted: Feb 19, 2007 at 4:48 PM ---- --------------------------------------------------------------------------------------- ---> // Loop over each hottie. $( "#girls a.hottie" ).each( // For each hottie, run this code. The "indIndex" is the // loop iteration index on the current element. function( intIndex ){ // Bind the onclick event to simply alert the // iteration index value. $( this ).bind ( "click", function(){ alert( "Hottie index: " + intIndex ); } ); } );