Testing

var mylist = { "valuesx":[{"totalme":"2877","docid":"3"},{"totalme":"94","docid":"6"},{"totalme":"40","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":"316","docid":"95"},{"totalme":"66","docid":"96"},{"totalme":"84","docid":"97"},{"totalme":"86","docid":"98"},{"totalme":"81","docid":"99"},{"totalme":"80","docid":"100"},{"totalme":"84","docid":"101"},{"totalme":"88","docid":"103"},{"totalme":"85","docid":"104"},{"totalme":"52","docid":"105"},{"totalme":"249","docid":"106"},{"totalme":"86","docid":"107"},{"totalme":"94","docid":"108"},{"totalme":"374","docid":"109"},{"totalme":"425","docid":"110"},{"totalme":"80","docid":"111"},{"totalme":"49","docid":"112"},{"totalme":"84","docid":"113"},{"totalme":"233","docid":"114"},{"totalme":"41","docid":"115"},{"totalme":"75","docid":"116"},{"totalme":"88","docid":"117"},{"totalme":"51","docid":"118"},{"totalme":"88","docid":"119"},{"totalme":"77","docid":"120"},{"totalme":"88","docid":"121"},{"totalme":"96","docid":"122"},{"totalme":"139","docid":"123"},{"totalme":"4980","docid":"124"},{"totalme":"92","docid":"125"},{"totalme":"94","docid":"126"},{"totalme":"101","docid":"127"},{"totalme":"88","docid":"128"},{"totalme":"88","docid":"129"},{"totalme":"78","docid":"130"},{"totalme":"91","docid":"131"},{"totalme":"88","docid":"132"},{"totalme":"87","docid":"133"},{"totalme":"2","docid":"134"},{"totalme":"2","docid":"135"},{"totalme":"55","docid":"136"},{"totalme":"102","docid":"137"},{"totalme":"2","docid":"138"},{"totalme":"2","docid":"139"},{"totalme":"82","docid":"140"},{"totalme":"2","docid":"150"},{"totalme":"127","docid":"151"},{"totalme":"242","docid":"152"},{"totalme":"87","docid":"153"},{"totalme":"1746","docid":"154"},{"totalme":"109","docid":"155"},{"totalme":"5","docid":"156"},{"totalme":"44","docid":"157"},{"totalme":"75","docid":"158"},{"totalme":"434","docid":"159"},{"totalme":"69","docid":"160"},{"totalme":"101","docid":"161"},{"totalme":"84","docid":"162"},{"totalme":"632","docid":"163"},{"totalme":"82","docid":"164"},{"totalme":"80","docid":"165"},{"totalme":"79","docid":"166"},{"totalme":"78","docid":"167"},{"totalme":"48","docid":"168"},{"totalme":"91","docid":"169"},{"totalme":"79","docid":"170"},{"totalme":"54","docid":"172"},{"totalme":"121","docid":"173"},{"totalme":"51","docid":"174"},{"totalme":"84","docid":"175"},{"totalme":"103","docid":"176"},{"totalme":"86","docid":"177"},{"totalme":"79","docid":"178"},{"totalme":"100","docid":"179"},{"totalme":"84","docid":"180"},{"totalme":"102","docid":"181"},{"totalme":"5","docid":"182"},{"totalme":"82","docid":"183"},{"totalme":"88","docid":"184"},{"totalme":"98","docid":"185"},{"totalme":"85","docid":"186"},{"totalme":"86","docid":"187"},{"totalme":"1308","docid":"188"},{"totalme":"85","docid":"189"},{"totalme":"94","docid":"190"},{"totalme":"93","docid":"191"},{"totalme":"104","docid":"192"},{"totalme":"139","docid":"193"},{"totalme":"96","docid":"194"},{"totalme":"94","docid":"195"},{"totalme":"84","docid":"196"},{"totalme":"99","docid":"197"},{"totalme":"97","docid":"198"},{"totalme":"81","docid":"199"},{"totalme":"31","docid":"201"},{"totalme":"23","docid":"202"},{"totalme":"31","docid":"203"},{"totalme":"43","docid":"204"},{"totalme":"53","docid":"205"},{"totalme":"17","docid":"206"},{"totalme":"40","docid":"207"},{"totalme":"90","docid":"208"},{"totalme":"90","docid":"209"},{"totalme":"183","docid":"210"},{"totalme":"67","docid":"211"},{"totalme":"80","docid":"212"},{"totalme":"108","docid":"213"},{"totalme":"89","docid":"214"},{"totalme":"85","docid":"218"},{"totalme":"29","docid":"219"},{"totalme":"5","docid":"220"},{"totalme":"113","docid":"221"},{"totalme":"68","docid":"222"},{"totalme":"117","docid":"223"},{"totalme":"370","docid":"224"},{"totalme":"81","docid":"225"},{"totalme":"147","docid":"226"},{"totalme":"183","docid":"227"},{"totalme":"176","docid":"228"},{"totalme":"122","docid":"229"},{"totalme":"98","docid":"230"},{"totalme":"712","docid":"232"},{"totalme":"116","docid":"233"},{"totalme":"95","docid":"234"},{"totalme":"82","docid":"235"},{"totalme":"103","docid":"238"},{"totalme":"133","docid":"239"},{"totalme":"142","docid":"240"},{"totalme":"113","docid":"241"},{"totalme":"233","docid":"243"},{"totalme":"18","docid":"246"},{"totalme":"345","docid":"250"},{"totalme":"164","docid":"251"},{"totalme":"53","docid":"252"},{"totalme":"88","docid":"253"},{"totalme":"3911","docid":"255"},{"totalme":"937","docid":"256"},{"totalme":"995","docid":"257"},{"totalme":"2748","docid":"258"},{"totalme":"8","docid":"259"},{"totalme":"486","docid":"262"},{"totalme":"540","docid":"263"},{"totalme":"976","docid":"264"},{"totalme":"168","docid":"265"},{"totalme":"107","docid":"266"},{"totalme":"215","docid":"267"},{"totalme":"783","docid":"268"},{"totalme":"303","docid":"269"},{"totalme":"1808","docid":"270"},{"totalme":"59","docid":"271"},{"totalme":"63","docid":"272"},{"totalme":"311","docid":"273"},{"totalme":"1237","docid":"274"},{"totalme":"359","docid":"275"},{"totalme":"494","docid":"276"},{"totalme":"103","docid":"277"},{"totalme":"182","docid":"278"},{"totalme":"22","docid":"279"},{"totalme":"196","docid":"280"},{"totalme":"2742","docid":"281"},{"totalme":"443","docid":"282"},{"totalme":"518","docid":"283"},{"totalme":"1551","docid":"284"},{"totalme":"2932","docid":"285"},{"totalme":"567","docid":"286"},{"totalme":"538","docid":"287"},{"totalme":"431","docid":"288"},{"totalme":"134","docid":"289"},{"totalme":"17","docid":"290"},{"totalme":"513","docid":"291"},{"totalme":"400","docid":"292"},{"totalme":"676","docid":"293"},{"totalme":"550","docid":"294"},{"totalme":"1512","docid":"295"},{"totalme":"329","docid":"296"},{"totalme":"2776","docid":"297"},{"totalme":"1274","docid":"298"},{"totalme":"1342","docid":"299"},{"totalme":"293","docid":"300"},{"totalme":"615","docid":"301"},{"totalme":"379","docid":"302"},{"totalme":"889","docid":"303"},{"totalme":"1185","docid":"304"},{"totalme":"833","docid":"305"},{"totalme":"1249","docid":"306"},{"totalme":"887","docid":"307"},{"totalme":"614","docid":"308"},{"totalme":"501","docid":"309"},{"totalme":"393","docid":"310"},{"totalme":"247","docid":"311"},{"totalme":"1334","docid":"312"},{"totalme":"283","docid":"313"},{"totalme":"271","docid":"314"},{"totalme":"2070","docid":"315"},{"totalme":"230","docid":"316"},{"totalme":"278","docid":"317"},{"totalme":"6431","docid":"318"},{"totalme":"1151","docid":"319"},{"totalme":"940","docid":"320"},{"totalme":"971","docid":"321"},{"totalme":"567","docid":"322"},{"totalme":"51","docid":"323"},{"totalme":"2666","docid":"324"},{"totalme":"1150","docid":"325"},{"totalme":"599","docid":"326"},{"totalme":"1612","docid":"327"},{"totalme":"1276","docid":"328"},{"totalme":"1085","docid":"329"},{"totalme":"1514","docid":"330"},{"totalme":"4","docid":"331"},{"totalme":"1","docid":"332"},{"totalme":"628","docid":"333"},{"totalme":"937","docid":"334"},{"totalme":"197","docid":"335"},{"totalme":"701","docid":"336"},{"totalme":"1819","docid":"337"},{"totalme":"1066","docid":"338"},{"totalme":"459","docid":"339"},{"totalme":"10898","docid":"340"},{"totalme":"784","docid":"341"},{"totalme":"981","docid":"342"},{"totalme":"1864","docid":"343"},{"totalme":"532","docid":"344"},{"totalme":"1472","docid":"345"},{"totalme":"436","docid":"346"},{"totalme":"540","docid":"347"},{"totalme":"553","docid":"348"},{"totalme":"607","docid":"349"},{"totalme":"1437","docid":"350"},{"totalme":"19","docid":"351"},{"totalme":"741","docid":"352"},{"totalme":"412","docid":"353"},{"totalme":"607","docid":"354"},{"totalme":"3629","docid":"355"},{"totalme":"884","docid":"356"},{"totalme":"635","docid":"357"},{"totalme":"1329","docid":"358"},{"totalme":"661","docid":"359"},{"totalme":"1588","docid":"360"},{"totalme":"412","docid":"361"},{"totalme":"807","docid":"362"},{"totalme":"1364","docid":"363"},{"totalme":"200","docid":"364"},{"totalme":"1116","docid":"365"},{"totalme":"1076","docid":"366"},{"totalme":"1149","docid":"367"},{"totalme":"2353","docid":"368"},{"totalme":"1913","docid":"369"},{"totalme":"1400","docid":"370"},{"totalme":"740","docid":"371"},{"totalme":"1217","docid":"372"},{"totalme":"2027","docid":"373"},{"totalme":"708","docid":"374"},{"totalme":"1333","docid":"375"},{"totalme":"857","docid":"376"},{"totalme":"454","docid":"377"},{"totalme":"857","docid":"378"},{"totalme":"2944","docid":"379"},{"totalme":"786","docid":"380"},{"totalme":"998","docid":"381"},{"totalme":"557","docid":"382"},{"totalme":"2173","docid":"383"},{"totalme":"1386","docid":"384"},{"totalme":"1576","docid":"385"},{"totalme":"337","docid":"386"},{"totalme":"189","docid":"387"},{"totalme":"481","docid":"388"},{"totalme":"660","docid":"389"},{"totalme":"296","docid":"390"},{"totalme":"320","docid":"391"},{"totalme":"463","docid":"392"},{"totalme":"643","docid":"393"},{"totalme":"769","docid":"394"},{"totalme":"1224","docid":"395"},{"totalme":"957","docid":"396"},{"totalme":"695","docid":"397"},{"totalme":"202","docid":"398"},{"totalme":"2","docid":"399"},{"totalme":"1","docid":"401"},{"totalme":"1123","docid":"402"},{"totalme":"96","docid":"403"},{"totalme":"546","docid":"404"},{"totalme":"1267","docid":"405"},{"totalme":"517","docid":"406"},{"totalme":"227","docid":"407"},{"totalme":"162","docid":"408"},{"totalme":"38","docid":"409"},{"totalme":"515","docid":"410"},{"totalme":"272","docid":"411"},{"totalme":"464","docid":"412"},{"totalme":"21","docid":"413"},{"totalme":"55","docid":"414"},{"totalme":"1822","docid":"415"},{"totalme":"669","docid":"416"},{"totalme":"1034","docid":"417"},{"totalme":"626","docid":"418"},{"totalme":"903","docid":"419"},{"totalme":"952","docid":"420"},{"totalme":"528","docid":"421"},{"totalme":"289","docid":"422"},{"totalme":"8","docid":"423"},{"totalme":"736","docid":"424"},{"totalme":"2061","docid":"425"},{"totalme":"523","docid":"426"},{"totalme":"143","docid":"427"},{"totalme":"147","docid":"428"},{"totalme":"265","docid":"429"},{"totalme":"150","docid":"430"},{"totalme":"2537","docid":"431"},{"totalme":"405","docid":"432"},{"totalme":"728","docid":"433"},{"totalme":"314","docid":"434"},{"totalme":"1159","docid":"435"},{"totalme":"309","docid":"436"},{"totalme":"877","docid":"437"},{"totalme":"278","docid":"438"},{"totalme":"21391","docid":"439"},{"totalme":"385","docid":"440"},{"totalme":"732","docid":"441"},{"totalme":"891","docid":"442"},{"totalme":"534","docid":"443"},{"totalme":"1282","docid":"444"},{"totalme":"363","docid":"445"},{"totalme":"368","docid":"446"},{"totalme":"3607","docid":"447"},{"totalme":"683","docid":"448"},{"totalme":"620","docid":"449"},{"totalme":"1035","docid":"450"},{"totalme":"404","docid":"451"},{"totalme":"450","docid":"452"},{"totalme":"751","docid":"453"},{"totalme":"260","docid":"454"},{"totalme":"558","docid":"455"},{"totalme":"707","docid":"456"},{"totalme":"1098","docid":"457"},{"totalme":"679","docid":"458"},{"totalme":"629","docid":"459"},{"totalme":"1180","docid":"460"},{"totalme":"714","docid":"461"},{"totalme":"117","docid":"462"},{"totalme":"1231","docid":"463"},{"totalme":"1495","docid":"464"},{"totalme":"102","docid":"465"},{"totalme":"163","docid":"466"},{"totalme":"1184","docid":"467"},{"totalme":"411","docid":"468"},{"totalme":"440","docid":"469"},{"totalme":"1488","docid":"470"},{"totalme":"399","docid":"471"},{"totalme":"522","docid":"472"},{"totalme":"383","docid":"473"},{"totalme":"455","docid":"474"},{"totalme":"222","docid":"475"},{"totalme":"643","docid":"476"},{"totalme":"106","docid":"477"},{"totalme":"324","docid":"478"},{"totalme":"463","docid":"479"},{"totalme":"125","docid":"480"},{"totalme":"397","docid":"481"},{"totalme":"290","docid":"482"},{"totalme":"713","docid":"483"},{"totalme":"392","docid":"484"},{"totalme":"214","docid":"485"},{"totalme":"1052","docid":"486"},{"totalme":"385","docid":"487"},{"totalme":"532","docid":"488"},{"totalme":"290","docid":"489"},{"totalme":"1362","docid":"490"},{"totalme":"634","docid":"491"},{"totalme":"74","docid":"492"},{"totalme":"108","docid":"493"},{"totalme":"3416","docid":"494"},{"totalme":"218","docid":"495"},{"totalme":"272","docid":"496"},{"totalme":"483","docid":"497"},{"totalme":"1224","docid":"498"},{"totalme":"233","docid":"499"},{"totalme":"266","docid":"500"},{"totalme":"226","docid":"501"},{"totalme":"155","docid":"502"},{"totalme":"140","docid":"503"}] }; $.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); });