Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 70
  • Last Modified:

javascript email link with image

Hi experts,

I have this code that works fine
<p>
                <script language=javascript>
                  <!--
                  var contact = "Email us!"
                  var email = "mailbox"
                  var emailHost = "fobgfc.org"
                  document.write("<a href=" + "mail" + "to:" + email + "@" + emailHost+ ">" + contact + "</a>")
                  //-->
                </script>
</p>

Open in new window


but I wanted to spice it up with an image, rather than just "Email us!" text...how would I do that please?

Cheers,

  Col
0
colinspurs
Asked:
colinspurs
1 Solution
 
leakim971PluritechnicianCommented:
Test page : https://jsfiddle.net/orc2cgte/

<p>
                <script language=javascript>
                  <!--
                  var contact = "<img src='http://tours.aurora-service.eu/images/contact-us.jpg' alt='Email us!' />"
                  var email = "mailbox"
                  var emailHost = "fobgfc.org"
                  document.write("<a href=" + "mail" + "to:" + email + "@" + emailHost+ ">" + contact + "</a>")
                  //-->
                </script>
</p>

Open in new window

1
 
colinspursAuthor Commented:
Perfect, thanks.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now