Set the href value to point to an email address:
location.href = "mailto:someone@example.com";
Click the button to set the href value to link to a specified mail address.
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Send mail</button> <script> function myFunction() {//w w w . j a v a 2 s .c om location.href = "mailto:someone@example.com"; } </script> </body> </html>