ronniebrown
08-21-2006, 12:46 PM
Hi,
I'm working on a site that has some code that I cannot get access to. Within this code, there are two <LINK> stylesheets that overwrite all the (correct) styles given to the page in the <HEAD> tag.
I would like to remove these <LINK> tags from the page and have tried to do so with the following code:
function delItem() {
myElement = document.getElementsByTagName("link");
if(myElement.length) {
lastElement = myElement.item(myElement.length-1)
docBody = document.getElementsByTagName("body").item(0)
removed = docBody.removeChild(lastElement)
}
}
This code works if I change the getElementsByTagName to "p", "div" or something similar, but not on the <LINK> tag.
The offending items are sitting inside a uniquely named div but, unfortunately, have no ID or class of their own.
Is there another way of doing this?
Thanks
r
I'm working on a site that has some code that I cannot get access to. Within this code, there are two <LINK> stylesheets that overwrite all the (correct) styles given to the page in the <HEAD> tag.
I would like to remove these <LINK> tags from the page and have tried to do so with the following code:
function delItem() {
myElement = document.getElementsByTagName("link");
if(myElement.length) {
lastElement = myElement.item(myElement.length-1)
docBody = document.getElementsByTagName("body").item(0)
removed = docBody.removeChild(lastElement)
}
}
This code works if I change the getElementsByTagName to "p", "div" or something similar, but not on the <LINK> tag.
The offending items are sitting inside a uniquely named div but, unfortunately, have no ID or class of their own.
Is there another way of doing this?
Thanks
r