Skip to content

Instantly share code, notes, and snippets.

@WordPress-Handbuch
Created March 1, 2019 09:24
Show Gist options
  • Save WordPress-Handbuch/979c25a9dbef3e8df3bb4cf9596e6994 to your computer and use it in GitHub Desktop.
Save WordPress-Handbuch/979c25a9dbef3e8df3bb4cf9596e6994 to your computer and use it in GitHub Desktop.
Dynamic generation (CSS) of a contact e-mail address as a measure against simple scan bots
<a data-name="info" data-domain="wordpress-handbuch" data-tld="com" data-subject="Betreffzeile" href="#" class="verschleierteemailadresse" onclick="window.location.href = 'mailto:' + this.dataset.name + '@' + this.dataset.domain + '.' + this.dataset.tld + '?subject=' + this.dataset.subject"></a>
<style>
.verschleierteemailadresse:after {
content: attr(data-name) "@" attr(data-domain) "." attr(data-tld);
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment