Skip to content
Advertisement

Replace all the coincidences in an inline function

I have a string that is a numbrer str=’20.000.000′ I want another string that adds 1 to that number str=’20.000.001′ i do

document.getElementById('lblndescargas').innerHTML=Intl.NumberFormat('de-DE').format(parseInt(document.getElementById('lblndescargas').innerHTML.replace('.',''))+1)

But it replace only the first ‘.’.

How to resolve it?

Thanks a lot!

Advertisement

Answer

use

innerHTML.replaceAll(‘.’,”)

Advertisement