C
contact
Hi, I'm trying to use the following to replace a text string in all the
links on a page:
var arrLinks = document.links;
for(var LinkIterator = 0; LinkIterator < arrLinks.length;
LinkIterator++) {
if(arrLinks[LinkIterator].firstChild.nodeValue == "More
Information"){
arrLinks[LinkIterator].firstChild.nodeValue = "More";
};
};
I'm getting an object required error for this line:
if(arrLinks[LinkIterator].firstChild.nodeValue == "More Information"){
Why is that? Also, I've placed this code near the bottom of the page.
Is this the correct way to do it? Should I be placing it in a function
and calling that? I'm a bit new to this. Thanks for your help.
links on a page:
var arrLinks = document.links;
for(var LinkIterator = 0; LinkIterator < arrLinks.length;
LinkIterator++) {
if(arrLinks[LinkIterator].firstChild.nodeValue == "More
Information"){
arrLinks[LinkIterator].firstChild.nodeValue = "More";
};
};
I'm getting an object required error for this line:
if(arrLinks[LinkIterator].firstChild.nodeValue == "More Information"){
Why is that? Also, I've placed this code near the bottom of the page.
Is this the correct way to do it? Should I be placing it in a function
and calling that? I'm a bit new to this. Thanks for your help.