Replace all the coincidences in an inline function

Tags:



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!

Answer

use

innerHTML.replaceAll(‘.’,”)



Source: stackoverflow