Anti Spam email link


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

Instead of writing the link in the HTML, just write the email address inside any tag you want (p, spam, div...) with the class "email", and put "[at]" instead "@". This script replace the "[at]" and create the link outside the spam robot sight


Copy this code and paste it in your HTML
  1. $.each($('.email'), function(){
  2. var mail = $(this).text();
  3. mail = mail.replace('[at]','@');
  4. $(this).html('<a href="mailto:' + mail + '>' + mail + '</a>');
  5. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.