I have a list of 20+ links across a site. For example:
/one2one/r/Data/Quote/
/one2one/r/Data/Quote/business/
/one2one/r/Data/Quote/commercial/
They all commonly contain the same query strings.
The intention is to set attributes through Adobe DTM e.g. open in a new tab. This is currently what I have working for one of the links. However we have 20+ links across the site. Is there a way I can amend this so either it picks up all links that contain this query string or perhaps i can add them as an array and maintain manually? I've tested both but i'm not sure I am doing it correctly as neither work.
Any help would be appreciated. Thanks in advance.
var els = document.querySelectorALL("a[href='/one2one/r/Data/Quote/']");
for (var i=0; i < els.length; i++) {
els[i].setAttribute("target", "_blank");
}