Created
May 17, 2025 10:46
-
-
Save oharsta/8b4fd96a8b2b1e0e0b5b053be2a22c8b to your computer and use it in GitHub Desktop.
Dynamic mailto link
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
export const dynamicMailToLink = email => { | |
const link = document.createElement("a"); | |
link.href = `mailto:${email}` | |
link.style.display = "none"; | |
document.body.appendChild(link); | |
link.click(); | |
document.body.removeChild(link); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment