Javascript examples for DOM Event:onclick
Add hyperlink or trigger onClick event in email body
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> function mailTo(mailAddr){/*from w w w. j a va2 s. c o m*/ var aTag = document.createElement("a"); aTag.href = "mailto:" + mailAddr; aTag.id = "openMailClient"; aTag.target = "_blank"; aTag.innerHTML = " "; aTag.click(); } </script> </head> <body> <button onclick="mailTo('abc@example.com')">Test</button> </body> </html>