I think something like this might be the starting point:
var links = document.getElementsByTagName("a"); //use div object here instead of document for (var i=0; i<links.length; i++) { if (links[i].href.substring(0, 5) == 'https') { links[i].setAttribute('title', 'abc'); links[i].setAttribute('class', 'abc'); links[i].setAttribute('className', 'abc'); } }
you can also skip all A elements in the document and check the parent to see if the div is the one you are looking for
xmt14
source share