jquery foreach on array 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() );
});
Example 3: jq each loop
$( "div" ).each(function( index ) {
//console.log( index )
modal_desc = $(this).length;
if(modal_desc > 20){
//code
}
});
Example 4: $.each( function(key value){$get()}
$.each( function(key value){$get()}