I'm attempting to follow an older tutorial to change all references of the word "cão" on a page to "gato". These instances are contained within spans, and I'm using the getElementsByTagName method in my script. However, when trying to cycle through each position with a for loop, I encounter a syntax error after the increment i++. Can anyone explain why this is happening?
var elementoHeading = document.getElementById('heading');
elementoHeading.innerHTML = "Tudo sobre gatos";
var nomesTags = document.getElementsByTagName("span");
for (var i = 0; i < nomesTags.length; i++) {
nomesTags[i].innerHTML = "gato";
}