I have the following function:
function eli() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("A");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("HREF") && anchor.getAttribute("rel") ==
"external") {
anchor.target = "_blank";
}
}
}
I run this function here : <body onload="eli();">. It adds the
target="_blank" attribute to all links that are written as follows:
<A HREF="http://www.somefruitcakesite.com" rel="external">my link</a>
How do I make it case insensitive. So that it also picks up:
<A href="http://www.somefruitcakesite.com" rel="EXTERNAL">my link</a>
<A href="http://www.somefruitcakesite.com" REL="external">my link</a>
etc...
Or is that too much work and should I adjust my html.
TIA
Nicolaas