$('.email').each(function(i) { var mail = $(this).html(); mail = mail.replace(" [at] ", "@"); mail = mail.replace(" [dot] ", "."); $(this).html(mail).replaceWith("<a href=\"mailto:" + $(this).text() + "\">" + $(this).text() + "</a>"); });
p{margin: 25px ;}
<p> Email : <em class="email">foo [at] example [dot] com</em></p>