1$.each(largeJSONobject.ReleatedDoc, function (index,value) {
2 $('select.mrdDisplayBox').addOption(value.Id, value.Id + ' - ' + value.Number, false);
3});
1<ul>
2 <li>foo</li>
3 <li>bar</li>
4</ul>
5
6$( "li" ).each(function( index ) {
7 console.log( index + ": " + $( this ).text() );
8});
9
10//be aware that the .each() method is unnecessary here:
11$( "li" ).each(function() {
12 $( this ).addClass( "foo" );
13});
14
15//instead, you should rely on implicit iteration:
16$( "li" ).addClass( "bar" );