I know there are plugins that do this, but I need something quite specific, and I canβt find anything.
I need a jQuery script that only changes the mailto link, not the link text. For example:
<a href="person(at)exammple.com">Person Email</a>
I need to show something else inside the link besides the actual email address. script I tried to use this this site .
Here's the script:
jQuery.fn.mailto = function() { return this.each(function(){ var email = $(this).html().replace(/\s*\(.+\)\s*/, "@"); $(this).before('<a href="mailto:' + email + '" rel="nofollow" title="Email ' + email + '">' + email + '</a>').remove(); }); };
I think I need to replace the "email" variable with something else between the <a> tags, but I'm not sure what. I'm still pretty new to jQuery.
Thanks.
JacobTheDev
source share