Monday, February 13, 2012

The Beauty Of The jQuery Each() Method

The Beauty Of The jQuery Each() Method: "// 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 );
}
);
 
}
 
);"

'via Blog this'