jquery eah code example
Example 1: jquery foreach
$.each( obj, function( key, value ) {
alert( key + ": " + value );
});
Example 2: jquery each array object
$.each(largeJSONobject.ReleatedDoc, function (index,value) {
$('select.mrdDisplayBox').addOption(value.Id, value.Id + ' - ' + value.Number, false);
});
Example 3: jquery eah
<ul>
<li>foo</li>
<li>bar</li>
</ul>
$( "li" ).each(function( index ) {
console.log( index + ": " + $( this ).text() );
});
$( "li" ).each(function() {
$( this ).addClass( "foo" );
});
$( "li" ).addClass( "bar" );