jQuery(document).ready(function() { var counter = 22405; for(i=0;i<8;i++) { j = counter % 10; counter = (counter - counter % 10) / 10; jQuery("#Counter").append(''); } });