Result
jQuery
$('.email').each(function(i) { var mail = $(this).html(); //置換文字の指定 mail = mail.replace(" [at] ", "@"); mail = mail.replace(" [dot] ", "."); //mailtoリンクに含める $(this).html(mail).replaceWith("<a href=\"mailto:" + $(this).text() + "\">" + $(this).text() + "</a>"); });
html
Email : <em class="email">foo [at] example [dot] com</em>