mahi
mahi

Reputation: 41

how to redirect to email address when ckick on email address through java script?

i wanted to redirect the email when i m click on the email address which provide by user... hep me....

what m i done....

 <li onClick="madd(this)" data-ajax="false">[email protected]</li>

javascript code is....

  function madd(add)
{
    var address="";
    var address=$(add).text();
    alert(address);
    window.location.href=address;
}

but it just try to find the page named as [email protected] .... so what can i do????????

Upvotes: 0

Views: 472

Answers (2)

Anthed
Anthed

Reputation: 149

Do you mean :

<a href="mailto:[email protected]">Send</a>

Upvotes: 0

A Paul
A Paul

Reputation: 8261

Try this

<a href="mailto:[email protected]" data-ajax="false">[email protected]</a>

Upvotes: 2

Related Questions