Location href Property - Set the href value to point to an email address - Javascript Browser Object Model

Javascript examples for Browser Object Model:Location

Description

Location href Property - Set the href value to point to an email address

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Send mail</button>

<script>
function myFunction() {/*  w  ww  .j  av  a 2 s.c o m*/
    location.href = "mailto:someone@example.com";
}
</script>

</body>
</html>

Related Tutorials