[Solved] How to replace comma with semi colon for inner html or text


The simplest working, but ugly way:

document.querySelector('.myclass').innerHTML =  document.querySelector('.myclass').innerHTML.replace(/<\/a>,/g, '</a>;');

Nicer way, though still ugly:

var toReplace = document.querySelector('.myclass');
toReplace.innerHTML = toReplace.innerHTML.replace(/<\/a>,/g, '</a>;');

0

solved How to replace comma with semi colon for inner html or text