.each Test

Testing the index value passed by .each function

by Somenath Sinha

HTML

<ul>
  <li>foo</li>
  <li>bar</li>
</ul>

JavaScript

$( "li" ).each(function( index ) {
  console.log( index + ": " + $( this ).text() );
});