Last active
December 2, 2018 15:05
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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