How Jquery knows that "intIndex" is the loop iteration index?
The example, which i do not understand is from: http://www.bennadel.co m/blog/534-the-beauty-of-the-jquery-each-method.htm
The example, which i do not understand is from: http://www.bennadel.co m/blog/534-the-beauty-of-the-jquery-each-method.htm
Code:
// 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 );
}
);
}
);
Comment