I have the following JQUERY Function:
function siteCounterUpdate(n) {
$('ul#indexSiteCounterBottom').empty();
for(i=0;i<9;i++) {
//alert(n.toString()[i]);
$('ul#indexSiteCounterBottom').append('<li>'+n.toString()[i]+'</li>');
$('ul#indexSiteCounterBottom li:nth-child(3n)').addClass('extra-margin');
}
}
The function receives a number (string) and if its 9 characters long it works perfectly. 9 is the full length.
However if the number is say 7 characters long I need the first 2 items to be replaced with a HTML no breaking space.
I'm struggling to understand how I can do this.
eg: 6 character long string would be 1. nbsp 2. nbsp 3. nbsp 4 - 9. the string.
any advice would be great.
thx