I'm trying to sort through the links on my page and make some of them open into a new window, depending on their URL. This is the code I have. It doesn't seem to be working. Can you see why?
function MakeMenuLinksOpenInNewWindow() {
var links = document.getElementsByTagName("a");
for (var i = 0; i < links.length; i++) {
if (links[i].href == "http://testtesttest.org/")
links[i].target = "_blank";
}
}
MakeMenuLinksOpenInNewWindow();