Skip to content

Instantly share code, notes, and snippets.

@adam-acosta
Last active July 29, 2018 20:16
Show Gist options
  • Save adam-acosta/d07ef2bc844a49ce8acc6d5966c57f29 to your computer and use it in GitHub Desktop.
Save adam-acosta/d07ef2bc844a49ce8acc6d5966c57f29 to your computer and use it in GitHub Desktop.
easy fieldlevel add recipients by clicking all 'Add' buttons
// https://stackoverflow.com/a/45089849
function getElementsByText(str, tag = 'a') {
return Array.prototype.slice.call(document.getElementsByTagName(tag)).filter(el => el.textContent.trim() === str.trim());
}
var addButtons = getElementsByText('Add', 'button');
for(var i = 0; i <= addButtons.length-1; i++) {
addButtons[i].click();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment