I have an xml dictionary as shown below.
<word definition = "The primary income-earner in a household" & gtbread winner & lt / word & gt
<word definition = "One who wins, or gains by success in competition, contest, or gaming" & gtwinner & lt / word & gt
When there is a word from the dictionary in my html, this word will be replaced by the link and the definition as title. When the link freezes, the user should see the definition.
var allwords = xmlDoc.getElementsByTagName ("word");
for (var i = 0; i <allwords.length; i ++)
{
var name = allwords [i] .lastChild.nodeValue;
var linked = '<a href ="#" title="' + allwords[ii.lastChild.nodeValue +':' + allwords[i†.getAttribute("definition") +'"> '+ allwords [i] .lastChild.nodeValue + '</a>';
}
Here is my substitute
function replacer (oldstring, newstring) {
document.body.innerHTML = document.body.innerHTML.replace (oldstring, newstring);
}
But the problem is once the bread winner changes to a connected form, it will also win , since the bread winner includes the winner , the winner changes twice, and the whole code is mixed.
I ask if there is a way, after the winner of the bread changes, the winner should no longer change.
!