Last active
February 27, 2017 08:55
-
-
Save bitboxx/673badf889cc556b45cbe5528ea94d7a to your computer and use it in GitHub Desktop.
Copy list on a website to clipboard
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
// Get certain list from website and copy it to clipboard | |
window.copyListToClipboard = (selector, elementProperty, linePrefix = '') => { | |
let list = ''; | |
document.querySelectorAll(selector).forEach(element => { | |
list += linePrefix + element.getAttribute(elementProperty) + '\n'; | |
}); | |
copy(list); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment