Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

jQuery.emailProt (See related posts)

jQuery function to obfuscate email addresses.

jQuery.fn.emailProt = function(e) {
	$(this).each(function(){
		e = this.rel.replace('|','@');
		this.href = 'mailto:' + e;
		$(this).text(e);
	});
};


Usage:

$(document).ready(function(){
	$('.email').emailProt();	
});


<a rel="user|stylephreak.com" class="email"></a>

You need to create an account or log in to post comments to this site.