/ Published in: JavaScript
Run in the FireBug console, and copy the output. An odd class is included for row striping, and the number of items can be controlled via the for loop.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var namesArray; var names = "Sophie Twigg\nJanine Rappa\nCharley Vidmar\nWillena Tesoro\nSherril Zinke\nAmerica Konkel\nThalia Blackburn\nCatarina Monts\nNanci Haubert\nLoise Blackstock\nLong Kluender\nDelsie Kendricks\nMaurine Mccollister\nMika Lofton\nCathie Woolwine\nLarissa Baumgartner\nChelsey Mellott\nJere Lai\nAntonia Koth\nOlympia Selzer\nLatrisha Points\nSherrill Lis\nDemetrius Bien\nRobbie Leto\nGricelda Farlow\nTia Mcmillin\nPam Isakson\nDaisy Paden\nChaya Dejohn\nAmberly Mizer\nJanna Walcott\nDaphne Griffing\nRoselee Brunton\nShaunta Sylva\nLashaun Weisman\nWaneta Zaugg\nMarry Lafata\nReta Sobus\nNorine Curran\nNolan Manzione\nRutha Quesnell\nPercy Michell\nMaryalice Riemann\nLeif Welte\nMasako Charbonneau\nCleveland Dewolf\nErna Boddie\nGlenn Marler\nTerrilyn Coryell\nChrissy Wren\nCordia Lizardo\nMelissia Golan\nNatosha Marc\nDreama Helbig\nNenita Neubert\nWilbur Hetrick\nNadia Mell\nLoida Goens\nDalene Irle\nKatrina Rockefeller\nMarti Asselin\nKeira Whalley\nRonny Haning\nParker Piacente\nWendie Santigo\nJeremy Kantrowitz\nTeena Hemmings\nLuciano Argentieri\nNita Streater\nFidela Oberman\nDaniella Strawder\nPhyliss Inclan\nCalvin Flory\nInez Hinderman\nRosalind Berns\nTyson Brooker\nMaryjo Ro\nLorilee Jiang\nChing Sturtevant\nLyda Panetta"; namesArray = names.split("\n"); for(i=200; i < 270 ; i++){ j = i-199 if(i%2){ oddClass = ' class="odd"'; }else{ oddClass = ''; } console.log('<li'+oddClass+'><input id="id_'+i+'" type="checkbox" name="'+i+'" /><label for="id_'+i+'">'+namesArray[j]+'</label></li>'); }