Jump to content

[SOLVED] Hiding email address within HTML using JS


Yesideez

Recommended Posts

Hi, I've got this small JS script:

function doemail($name,$domain) {
  window.location='mailto:'.$name.'@'.$domain;
  return false;
}

 

In my HTML I've got this:

<a href="javascript:doemail('someone','hotmail.co.uk')">My NAme</a>

 

What I'm trying to do is make the link just like I've used "mailto:" in the href but it doesn't work. Any idea what's wrong with it please?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.