Skip to content

Instantly share code, notes, and snippets.

@zonay
Last active December 2, 2018 15:05
Show Gist options
  • Save zonay/aca0528ff453524c3cc80c07288cce04 to your computer and use it in GitHub Desktop.
Save zonay/aca0528ff453524c3cc80c07288cce04 to your computer and use it in GitHub Desktop.
This function extracts anchor links from each child nodes of element & replace its content with links
function extractURL () {
var defaultCont = document.querySelectorAll('td.column-data');
var x = document.querySelectorAll('td.column-data A');
console.log(x);
console.log(x.length);
console.log(x.item(1).outerHTML);
var xData = ''
for (var i = 0; i < x.length; i++) {
xData = x.item(i).outerHTML;
console.log(xData);
defaultCont.item(i).innerHTML = x.item(i).outerHTML;
}
}
extractURL();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment