Last active
April 12, 2017 16:29
-
-
Save carousel/09381d8c0abf6c8817743fdb84f77c43 to your computer and use it in GitHub Desktop.
Extract links from HTML document
This file contains hidden or 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
var arr = []; | |
var links = document.getElementsByTagName("a"); | |
for(var i=0; i<links.length; i++) { | |
arr.push(links[i].href); | |
} | |
for(i = 0; i < arr.length;i++){ | |
console.log(arr[i]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment