Testing

var mylist = { "valuesx":[{"totalme":"5296","docid":"3"},{"totalme":"170","docid":"6"},{"totalme":"74","docid":"56"},{"totalme":"60","docid":"57"},{"totalme":"47","docid":"68"},{"totalme":"54","docid":"77"},{"totalme":"69","docid":"88"},{"totalme":"58","docid":"90"},{"totalme":"55","docid":"92"},{"totalme":"41","docid":"93"},{"totalme":"80","docid":"94"},{"totalme":"465","docid":"95"},{"totalme":"66","docid":"96"},{"totalme":"186","docid":"97"},{"totalme":"180","docid":"98"},{"totalme":"186","docid":"99"},{"totalme":"170","docid":"100"},{"totalme":"192","docid":"101"},{"totalme":"202","docid":"103"},{"totalme":"169","docid":"104"},{"totalme":"52","docid":"105"},{"totalme":"446","docid":"106"},{"totalme":"175","docid":"107"},{"totalme":"189","docid":"108"},{"totalme":"472","docid":"109"},{"totalme":"531","docid":"110"},{"totalme":"228","docid":"111"},{"totalme":"49","docid":"112"},{"totalme":"160","docid":"113"},{"totalme":"362","docid":"114"},{"totalme":"41","docid":"115"},{"totalme":"160","docid":"116"},{"totalme":"212","docid":"117"},{"totalme":"51","docid":"118"},{"totalme":"183","docid":"119"},{"totalme":"171","docid":"120"},{"totalme":"186","docid":"121"},{"totalme":"197","docid":"122"},{"totalme":"282","docid":"123"},{"totalme":"5327","docid":"124"},{"totalme":"181","docid":"125"},{"totalme":"225","docid":"126"},{"totalme":"364","docid":"127"},{"totalme":"182","docid":"128"},{"totalme":"197","docid":"129"},{"totalme":"175","docid":"130"},{"totalme":"206","docid":"131"},{"totalme":"182","docid":"132"},{"totalme":"222","docid":"133"},{"totalme":"2","docid":"134"},{"totalme":"2","docid":"135"},{"totalme":"55","docid":"136"},{"totalme":"300","docid":"137"},{"totalme":"2","docid":"138"},{"totalme":"2","docid":"139"},{"totalme":"188","docid":"140"},{"totalme":"2","docid":"150"},{"totalme":"292","docid":"151"},{"totalme":"394","docid":"152"},{"totalme":"260","docid":"153"},{"totalme":"1983","docid":"154"},{"totalme":"292","docid":"155"},{"totalme":"5","docid":"156"},{"totalme":"44","docid":"157"},{"totalme":"75","docid":"158"},{"totalme":"597","docid":"159"},{"totalme":"69","docid":"160"},{"totalme":"244","docid":"161"},{"totalme":"178","docid":"162"},{"totalme":"762","docid":"163"},{"totalme":"246","docid":"164"},{"totalme":"183","docid":"165"},{"totalme":"184","docid":"166"},{"totalme":"183","docid":"167"},{"totalme":"48","docid":"168"},{"totalme":"240","docid":"169"},{"totalme":"159","docid":"170"},{"totalme":"54","docid":"172"},{"totalme":"277","docid":"173"},{"totalme":"51","docid":"174"},{"totalme":"169","docid":"175"},{"totalme":"236","docid":"176"},{"totalme":"182","docid":"177"},{"totalme":"168","docid":"178"},{"totalme":"210","docid":"179"},{"totalme":"193","docid":"180"},{"totalme":"232","docid":"181"},{"totalme":"5","docid":"182"},{"totalme":"82","docid":"183"},{"totalme":"198","docid":"184"},{"totalme":"222","docid":"185"},{"totalme":"179","docid":"186"},{"totalme":"197","docid":"187"},{"totalme":"1522","docid":"188"},{"totalme":"196","docid":"189"},{"totalme":"191","docid":"190"},{"totalme":"245","docid":"191"},{"totalme":"223","docid":"192"},{"totalme":"366","docid":"193"},{"totalme":"238","docid":"194"},{"totalme":"259","docid":"195"},{"totalme":"169","docid":"196"},{"totalme":"196","docid":"197"},{"totalme":"273","docid":"198"},{"totalme":"194","docid":"199"},{"totalme":"64","docid":"201"},{"totalme":"59","docid":"202"},{"totalme":"73","docid":"203"},{"totalme":"87","docid":"204"},{"totalme":"96","docid":"205"},{"totalme":"17","docid":"206"},{"totalme":"84","docid":"207"},{"totalme":"178","docid":"208"},{"totalme":"194","docid":"209"},{"totalme":"307","docid":"210"},{"totalme":"67","docid":"211"},{"totalme":"80","docid":"212"},{"totalme":"214","docid":"213"},{"totalme":"185","docid":"214"},{"totalme":"178","docid":"218"},{"totalme":"61","docid":"219"},{"totalme":"5","docid":"220"},{"totalme":"308","docid":"221"},{"totalme":"68","docid":"222"},{"totalme":"300","docid":"223"},{"totalme":"485","docid":"224"},{"totalme":"189","docid":"225"},{"totalme":"533","docid":"226"},{"totalme":"334","docid":"227"},{"totalme":"307","docid":"228"},{"totalme":"368","docid":"229"},{"totalme":"361","docid":"230"},{"totalme":"875","docid":"232"},{"totalme":"232","docid":"233"},{"totalme":"95","docid":"234"},{"totalme":"82","docid":"235"},{"totalme":"209","docid":"238"},{"totalme":"227","docid":"239"},{"totalme":"237","docid":"240"},{"totalme":"205","docid":"241"},{"totalme":"233","docid":"243"},{"totalme":"18","docid":"246"},{"totalme":"467","docid":"250"},{"totalme":"164","docid":"251"},{"totalme":"91","docid":"252"},{"totalme":"88","docid":"253"},{"totalme":"4314","docid":"255"},{"totalme":"937","docid":"256"},{"totalme":"1117","docid":"257"},{"totalme":"3227","docid":"258"},{"totalme":"8","docid":"259"},{"totalme":"611","docid":"262"},{"totalme":"673","docid":"263"},{"totalme":"976","docid":"264"},{"totalme":"168","docid":"265"},{"totalme":"213","docid":"266"},{"totalme":"407","docid":"267"},{"totalme":"976","docid":"268"},{"totalme":"446","docid":"269"},{"totalme":"1808","docid":"270"},{"totalme":"94","docid":"271"},{"totalme":"101","docid":"272"},{"totalme":"311","docid":"273"},{"totalme":"1418","docid":"274"},{"totalme":"359","docid":"275"},{"totalme":"743","docid":"276"},{"totalme":"198","docid":"277"},{"totalme":"269","docid":"278"},{"totalme":"22","docid":"279"},{"totalme":"196","docid":"280"},{"totalme":"2898","docid":"281"},{"totalme":"571","docid":"282"},{"totalme":"845","docid":"283"},{"totalme":"1644","docid":"284"},{"totalme":"3127","docid":"285"},{"totalme":"567","docid":"286"},{"totalme":"698","docid":"287"},{"totalme":"431","docid":"288"},{"totalme":"199","docid":"289"},{"totalme":"17","docid":"290"},{"totalme":"513","docid":"291"},{"totalme":"400","docid":"292"},{"totalme":"772","docid":"293"},{"totalme":"550","docid":"294"},{"totalme":"1631","docid":"295"},{"totalme":"462","docid":"296"},{"totalme":"2985","docid":"297"},{"totalme":"1390","docid":"298"},{"totalme":"1465","docid":"299"},{"totalme":"293","docid":"300"},{"totalme":"757","docid":"301"},{"totalme":"379","docid":"302"},{"totalme":"1013","docid":"303"},{"totalme":"1424","docid":"304"},{"totalme":"952","docid":"305"},{"totalme":"1419","docid":"306"},{"totalme":"1138","docid":"307"},{"totalme":"732","docid":"308"},{"totalme":"617","docid":"309"},{"totalme":"565","docid":"310"},{"totalme":"247","docid":"311"},{"totalme":"1334","docid":"312"},{"totalme":"283","docid":"313"},{"totalme":"365","docid":"314"},{"totalme":"2205","docid":"315"},{"totalme":"230","docid":"316"},{"totalme":"278","docid":"317"},{"totalme":"6638","docid":"318"},{"totalme":"1271","docid":"319"},{"totalme":"1166","docid":"320"},{"totalme":"971","docid":"321"},{"totalme":"567","docid":"322"},{"totalme":"51","docid":"323"},{"totalme":"2848","docid":"324"},{"totalme":"1261","docid":"325"},{"totalme":"599","docid":"326"},{"totalme":"1612","docid":"327"},{"totalme":"1409","docid":"328"},{"totalme":"1211","docid":"329"},{"totalme":"1668","docid":"330"},{"totalme":"4","docid":"331"},{"totalme":"1","docid":"332"},{"totalme":"822","docid":"333"},{"totalme":"937","docid":"334"},{"totalme":"318","docid":"335"},{"totalme":"809","docid":"336"},{"totalme":"1937","docid":"337"},{"totalme":"1247","docid":"338"},{"totalme":"459","docid":"339"},{"totalme":"11150","docid":"340"},{"totalme":"893","docid":"341"},{"totalme":"1146","docid":"342"},{"totalme":"2025","docid":"343"},{"totalme":"681","docid":"344"},{"totalme":"1472","docid":"345"},{"totalme":"436","docid":"346"},{"totalme":"654","docid":"347"},{"totalme":"553","docid":"348"},{"totalme":"843","docid":"349"},{"totalme":"1437","docid":"350"},{"totalme":"19","docid":"351"},{"totalme":"943","docid":"352"},{"totalme":"412","docid":"353"},{"totalme":"763","docid":"354"},{"totalme":"4468","docid":"355"},{"totalme":"1119","docid":"356"},{"totalme":"741","docid":"357"},{"totalme":"1451","docid":"358"},{"totalme":"763","docid":"359"},{"totalme":"1744","docid":"360"},{"totalme":"634","docid":"361"},{"totalme":"1055","docid":"362"},{"totalme":"1559","docid":"363"},{"totalme":"200","docid":"364"},{"totalme":"1417","docid":"365"},{"totalme":"1203","docid":"366"},{"totalme":"1263","docid":"367"},{"totalme":"2597","docid":"368"},{"totalme":"2034","docid":"369"},{"totalme":"1400","docid":"370"},{"totalme":"910","docid":"371"},{"totalme":"1484","docid":"372"},{"totalme":"2224","docid":"373"},{"totalme":"821","docid":"374"},{"totalme":"1575","docid":"375"},{"totalme":"988","docid":"376"},{"totalme":"587","docid":"377"},{"totalme":"1079","docid":"378"},{"totalme":"3098","docid":"379"},{"totalme":"927","docid":"380"},{"totalme":"1281","docid":"381"},{"totalme":"735","docid":"382"},{"totalme":"2341","docid":"383"},{"totalme":"1569","docid":"384"},{"totalme":"1795","docid":"385"},{"totalme":"337","docid":"386"},{"totalme":"294","docid":"387"},{"totalme":"589","docid":"388"},{"totalme":"825","docid":"389"},{"totalme":"296","docid":"390"},{"totalme":"456","docid":"391"},{"totalme":"585","docid":"392"},{"totalme":"643","docid":"393"},{"totalme":"914","docid":"394"},{"totalme":"1438","docid":"395"},{"totalme":"1082","docid":"396"},{"totalme":"863","docid":"397"},{"totalme":"202","docid":"398"},{"totalme":"2","docid":"399"},{"totalme":"1","docid":"401"},{"totalme":"1478","docid":"402"},{"totalme":"96","docid":"403"},{"totalme":"809","docid":"404"},{"totalme":"1421","docid":"405"},{"totalme":"740","docid":"406"},{"totalme":"227","docid":"407"},{"totalme":"162","docid":"408"},{"totalme":"38","docid":"409"},{"totalme":"515","docid":"410"},{"totalme":"272","docid":"411"},{"totalme":"569","docid":"412"},{"totalme":"21","docid":"413"},{"totalme":"55","docid":"414"},{"totalme":"2030","docid":"415"},{"totalme":"859","docid":"416"},{"totalme":"1166","docid":"417"},{"totalme":"743","docid":"418"},{"totalme":"1103","docid":"419"},{"totalme":"1074","docid":"420"},{"totalme":"655","docid":"421"},{"totalme":"413","docid":"422"},{"totalme":"8","docid":"423"},{"totalme":"885","docid":"424"},{"totalme":"2195","docid":"425"},{"totalme":"649","docid":"426"},{"totalme":"143","docid":"427"},{"totalme":"147","docid":"428"},{"totalme":"383","docid":"429"},{"totalme":"150","docid":"430"},{"totalme":"2940","docid":"431"},{"totalme":"512","docid":"432"},{"totalme":"1008","docid":"433"},{"totalme":"421","docid":"434"},{"totalme":"1342","docid":"435"},{"totalme":"425","docid":"436"},{"totalme":"1021","docid":"437"},{"totalme":"385","docid":"438"},{"totalme":"21615","docid":"439"},{"totalme":"520","docid":"440"},{"totalme":"988","docid":"441"},{"totalme":"1066","docid":"442"},{"totalme":"675","docid":"443"},{"totalme":"1722","docid":"444"},{"totalme":"494","docid":"445"},{"totalme":"498","docid":"446"},{"totalme":"3743","docid":"447"},{"totalme":"799","docid":"448"},{"totalme":"746","docid":"449"},{"totalme":"1348","docid":"450"},{"totalme":"524","docid":"451"},{"totalme":"652","docid":"452"},{"totalme":"873","docid":"453"},{"totalme":"409","docid":"454"},{"totalme":"688","docid":"455"},{"totalme":"1108","docid":"456"},{"totalme":"1337","docid":"457"},{"totalme":"799","docid":"458"},{"totalme":"752","docid":"459"},{"totalme":"1366","docid":"460"},{"totalme":"868","docid":"461"},{"totalme":"117","docid":"462"},{"totalme":"1401","docid":"463"},{"totalme":"1899","docid":"464"},{"totalme":"102","docid":"465"},{"totalme":"281","docid":"466"},{"totalme":"1530","docid":"467"},{"totalme":"535","docid":"468"},{"totalme":"591","docid":"469"},{"totalme":"1648","docid":"470"},{"totalme":"573","docid":"471"},{"totalme":"706","docid":"472"},{"totalme":"554","docid":"473"},{"totalme":"583","docid":"474"},{"totalme":"355","docid":"475"},{"totalme":"861","docid":"476"},{"totalme":"271","docid":"477"},{"totalme":"455","docid":"478"},{"totalme":"603","docid":"479"},{"totalme":"125","docid":"480"},{"totalme":"557","docid":"481"},{"totalme":"457","docid":"482"},{"totalme":"884","docid":"483"},{"totalme":"556","docid":"484"},{"totalme":"353","docid":"485"},{"totalme":"1218","docid":"486"},{"totalme":"510","docid":"487"},{"totalme":"647","docid":"488"},{"totalme":"404","docid":"489"},{"totalme":"1511","docid":"490"},{"totalme":"903","docid":"491"},{"totalme":"95","docid":"492"},{"totalme":"135","docid":"493"},{"totalme":"4254","docid":"494"},{"totalme":"401","docid":"495"},{"totalme":"413","docid":"496"},{"totalme":"618","docid":"497"},{"totalme":"2308","docid":"498"},{"totalme":"449","docid":"499"},{"totalme":"419","docid":"500"},{"totalme":"474","docid":"501"},{"totalme":"447","docid":"502"},{"totalme":"624","docid":"503"},{"totalme":"3029","docid":"504"},{"totalme":"2387","docid":"505"},{"totalme":"1380","docid":"506"},{"totalme":"332","docid":"507"},{"totalme":"1037","docid":"508"},{"totalme":"464","docid":"509"},{"totalme":"182","docid":"510"},{"totalme":"346","docid":"511"},{"totalme":"380","docid":"512"},{"totalme":"272","docid":"513"},{"totalme":"269","docid":"514"},{"totalme":"369","docid":"515"},{"totalme":"6","docid":"516"},{"totalme":"7","docid":"517"},{"totalme":"28","docid":"518"},{"totalme":"137","docid":"519"},{"totalme":"403","docid":"520"},{"totalme":"315","docid":"521"},{"totalme":"623","docid":"522"},{"totalme":"874","docid":"523"},{"totalme":"8","docid":"524"},{"totalme":"1022","docid":"525"},{"totalme":"1116","docid":"526"},{"totalme":"438","docid":"527"},{"totalme":"768","docid":"528"},{"totalme":"579","docid":"529"},{"totalme":"514","docid":"530"},{"totalme":"365","docid":"531"},{"totalme":"694","docid":"532"},{"totalme":"1482","docid":"533"},{"totalme":"433","docid":"534"},{"totalme":"435","docid":"535"},{"totalme":"120","docid":"536"},{"totalme":"544","docid":"537"},{"totalme":"359","docid":"538"},{"totalme":"692","docid":"539"},{"totalme":"374","docid":"540"},{"totalme":"368","docid":"541"},{"totalme":"642","docid":"542"},{"totalme":"555","docid":"543"},{"totalme":"383","docid":"544"},{"totalme":"566","docid":"545"},{"totalme":"503","docid":"546"},{"totalme":"492","docid":"547"},{"totalme":"447","docid":"548"},{"totalme":"392","docid":"549"},{"totalme":"636","docid":"550"},{"totalme":"885","docid":"551"},{"totalme":"775","docid":"552"},{"totalme":"649","docid":"553"},{"totalme":"636","docid":"554"},{"totalme":"122","docid":"555"},{"totalme":"531","docid":"556"},{"totalme":"403","docid":"557"},{"totalme":"1345","docid":"558"},{"totalme":"111","docid":"559"},{"totalme":"683","docid":"560"},{"totalme":"2015","docid":"561"},{"totalme":"528","docid":"562"},{"totalme":"4884","docid":"563"},{"totalme":"353","docid":"564"},{"totalme":"296","docid":"565"},{"totalme":"728","docid":"566"},{"totalme":"1543","docid":"567"},{"totalme":"1365","docid":"568"},{"totalme":"26","docid":"569"},{"totalme":"960","docid":"570"},{"totalme":"552","docid":"571"},{"totalme":"559","docid":"572"},{"totalme":"585","docid":"573"},{"totalme":"169","docid":"574"},{"totalme":"509","docid":"575"},{"totalme":"259","docid":"576"},{"totalme":"102","docid":"577"},{"totalme":"1386","docid":"578"},{"totalme":"698","docid":"579"},{"totalme":"608","docid":"580"},{"totalme":"1232","docid":"581"},{"totalme":"347","docid":"582"},{"totalme":"139","docid":"583"},{"totalme":"154","docid":"584"},{"totalme":"929","docid":"585"},{"totalme":"999","docid":"586"},{"totalme":"126","docid":"587"},{"totalme":"845","docid":"588"},{"totalme":"123","docid":"589"},{"totalme":"125","docid":"590"},{"totalme":"1040","docid":"591"},{"totalme":"443","docid":"592"},{"totalme":"667","docid":"593"},{"totalme":"100","docid":"594"},{"totalme":"113","docid":"595"},{"totalme":"261","docid":"596"},{"totalme":"1123","docid":"597"},{"totalme":"228","docid":"598"},{"totalme":"85","docid":"599"},{"totalme":"1126","docid":"600"},{"totalme":"137","docid":"601"},{"totalme":"105","docid":"602"},{"totalme":"643","docid":"603"},{"totalme":"422","docid":"604"},{"totalme":"252","docid":"605"},{"totalme":"242","docid":"606"},{"totalme":"4932","docid":"608"},{"totalme":"427","docid":"609"},{"totalme":"635","docid":"610"},{"totalme":"700","docid":"611"},{"totalme":"321","docid":"612"},{"totalme":"8390","docid":"613"},{"totalme":"306","docid":"614"},{"totalme":"138","docid":"615"},{"totalme":"231","docid":"616"},{"totalme":"207","docid":"617"},{"totalme":"409","docid":"618"},{"totalme":"630","docid":"619"},{"totalme":"523","docid":"620"},{"totalme":"133","docid":"621"},{"totalme":"140","docid":"622"},{"totalme":"443","docid":"623"},{"totalme":"702","docid":"624"},{"totalme":"783","docid":"625"},{"totalme":"339","docid":"626"},{"totalme":"1232","docid":"627"},{"totalme":"416","docid":"628"},{"totalme":"655","docid":"629"},{"totalme":"110","docid":"630"},{"totalme":"404","docid":"631"},{"totalme":"56","docid":"632"},{"totalme":"195","docid":"633"}] }; $.each(mylist.valuesx, function(index, element) { $('.videobox[data-idx="'+element.docid+'"]').data( "rank",element.totalme); $('.videobox[data-idx="'+element.docid+'"]').attr("data-rank",element.totalme); });