Email protection with mootools


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



Copy this code and paste it in your HTML
  1. <span rel="david|davidwalsh.name" class="email custom-class">Email me!</span>
  2.  
  3.  
  4. window.addEvent('domready', function() {
  5. $each($$('.email'), function(el) {
  6. var anchor = new Element('a', {
  7. href: 'mailto:' + el.get('rel').replace('|','@'),
  8. 'class': el.get('class'),
  9. }).replaces(el);
  10. });
  11. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.