I need to do a Javascript function that changes all words found inside a website. I've tried something like this:
var elements = document.getElementsByTagName('div');
for (var i = 0; i < elements.length; i++) {
var txt = elements.replace("Original","Alterada");
document.getElementsByTagName(i).element.innerHTML = txt;
}
But unfortunately it did not work. Several errors appear. Any solution?