Hi, I am newbie.
Please help me this:
The idea is to change the content within <money>123456789</money> to currency format every 3 seconds.
And this is my jquery:
- window.setInterval(function(){
- $('money').each(function () {
- var item = $(this).text();
- var num = Number(item).toLocaleString('en');
- $(this).text(num);
- });
- }, 3000);
The first executing is fine, the content turns to "123,456,789", but from the second executing, the content changes to "NaN".
So please kindly help me to keep the "123,456,789" if it's already in currency format.
Thank you in advance.