Skip to content

Instantly share code, notes, and snippets.

@maxbeatty
Created August 4, 2014 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxbeatty/e840e43aca67a82cc413 to your computer and use it in GitHub Desktop.
Save maxbeatty/e840e43aca67a82cc413 to your computer and use it in GitHub Desktop.
How I'm obfuscating email addresses in 2014
<p>
<strong>First Last</strong> whatever.
</p>
<a href="javascript:void(0)" class="pick-me">Email Me</a>
<script>
// sets href to "mailto:firstlast@domain.com"
document.querySelector('.pick-me').onclick = function (e) {
this.href = [
':otliam'.split('').reverse().join(''),
document.querySelector('p strong').textContent.toLowerCase().replace(/\s/, ''),
'@', 'domain.com'].join('')
]
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment