jquery forewach code example
Example 1: jquery foreach
$.each( obj, function( key, value ) {
alert( key + ": " + value );
});
Example 2: foreach jquery
$( "li" ).each(function( index ) {
console.log( index + ": " + $( this ).text() );
});
$.each( obj, function( key, value ) {
alert( key + ": " + value );
});
$( "li" ).each(function( index ) {
console.log( index + ": " + $( this ).text() );
});