Last active
February 20, 2018 17:43
-
-
Save ricardozea/602074af053dc00d57a7cddf639f753d to your computer and use it in GitHub Desktop.
Display email address link with CSS to avoid email harvesting.
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
<a data-name="info" data-domain="test" data-tld="com" href="#" class="cryptedmail" onclick="window.location.href = 'mailto:' + this.dataset.name + '@' + this.dataset.domain + '.' + this.dataset.tld"></a> | |
<style> | |
.cryptedmail:after { | |
content: attr(data-name) "@" attr(data-domain) "." attr(data-tld); | |
} | |
</style> | |
<!-- | |
Taken from this answer in SO: http://stackoverflow.com/a/41566570/321555 | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment