jQuery - Scramble Emails


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. //email spam protection - Example Markup: <span class="email">name[at]domain[dot]com</span>
  2. $('.email').each(function() {
  3. var $email = $(this);
  4. var address = $email.text()
  5. .replace(/\s*\[at\]\s*/, '@')
  6. .replace(/\s*\[dot\]\s*/g, '.');
  7. $email.html('<a href="mailto:' + address + '">'+ address +'</a>');
  8. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.