jquery for each syntax code example
Example: jquery loop over elements
$( "li" ).each(function( index ) {
console.log( index + ": " + $( this ).text() );
});
$( "li" ).each(function( index ) {
console.log( index + ": " + $( this ).text() );
});