Created
April 9, 2020 09:30
-
-
Save linuskohl/da54a28f1ac68f1e864b804ae2d8884b to your computer and use it in GitHub Desktop.
Extract list of links by class in jQuery
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
// load jQuery if it is not loaded already | |
var jq = document.createElement('script'); | |
jq.src = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
jQuery.noConflict(); | |
clear(); | |
var links = []; | |
$(CLASS).each(function(){ links.push($(this).attr('href')) }); | |
links; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment