Posted By

coryschadt on 12/15/09


Tagged

jquery


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jfherring


jQuery - Scramble Emails


 / Published in: jQuery
 

  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  

You need to login to post a comment.