Return to Snippet

Revision: 8249
at September 12, 2008 14:22 by fredaudet


Updated Code
<span rel="david|davidwalsh.name" class="email custom-class">Email me!</span>


window.addEvent('domready', function() {
	$each($$('.email'), function(el) {
		var anchor = new Element('a', {
			href: 'mailto:' + el.get('rel').replace('|','@'),
			'class': el.get('class'),
		}).replaces(el);
	});
});

Revision: 8248
at September 10, 2008 15:20 by fredaudet


Initial Code
<a href="/david|davidwalsh.name" class="email" title="Email me.">David Walsh</a>

$$('.email').each(function(el) { 
	el.set('href','mailto:' + el.get('href').replace('|','@').replace('/','')); 
});

Initial URL

                                

Initial Description

                                

Initial Title
Email protection with mootools

Initial Tags
email

Initial Language
HTML