Skip to content

Instantly share code, notes, and snippets.

View dissolvdgrl's full-sized avatar
building stuff

dissolvdgrl

building stuff
View GitHub Profile
function printEmail(className, first, last) {
let emailAddress = `<a href="mailto:${first}@${last}" class="link">${first}@${last}</a>`;
let span = document.querySelectorAll('.' + className), i;
for (i = 0; i < span.length; ++i) {
span[i].innerHTML = emailAddress;
}
}
printEmail('container', 'john', 'example.com');