Split number and put each digit to separate html element
- by Seven
The problem is that I do not know how to break the loop for the first number and start again for the next one. Currently, one span.nNumber has a total digits of the two numbers (123456) and the next span.nNumber contains digits only from another number (456).
Goal is to create sequence 123 and 456:
<span class='nNumber'>
<span>1</span>
<span>2</span>
<span>3</span>
</span>
and
<span class='nNumber'>
<span>4</span>
<span>5</span>
<span>6</span>
</span>
Example script: http://jsfiddle.net/PZ8Pt/2/