/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'/></script> <script type='text/javascript'> $(function() { $('.email').each(function(i) { var spamisTrash = $(this).html(); spamisTrash = spamisTrash.replace("[at]", "@"); spamisTrash = spamisTrash.replace("[dot]", "."); $(this).html(spamisTrash).replaceWith("<a href=\"mailto:" + $(this).text() + "\">" + $(this).text() + "</a>"); }); }); </script> <div class="email">YourEmailID[at]gmail[dot]com</div> <p class="email">YourEmailID[at]yahoo[dot]com</p> <span class="email">YourEmailID[at]blahblehbloh[dot]com</span>