I want to get specific links from my mail and open them in a new window.
I got this at the moment:
function OpenHrefsInNewWindow() {
//Get class name
var items = document.getElementsByClassName("confirm_link123");
var i = 0;
while(i < items.length)
{
//Get a part from the specific link
if (items[i].href.indexOf("confirm") > -1)
{
//If it does, open that URL in a new window.
window.open(items[i].href, "_blank");
}
i++; //Increment i here.
}
}
OpenHrefsInNewWindow();
But every time I get a new mail the classname is changing. So I got different classnames every time. So how can I do, to search only for the beginning of the class and change it in my code?
Any solutions? (: