I need to extract URL link from html.
<a rel="nofollow" href="link" class="1">
There is only one such link on the whole page.
Then I need to add use it as a.href in this function:
function changespan() {
var spans = document.querySelectorAll('span.image');
for (var i = spans.length; i--; ) {
var a = document.createElement('a');
a.href = "http://domain.com";
spans[i].appendChild(a).appendChild(a.previousSibling);
}
}
querySelectorAll, what is the problem? oO1it could beexternal-link, etc.