Invoke / click a mailto link with JQuery / JavaScript

前端 未结 4 584
遇见更好的自我
遇见更好的自我 2020-12-13 03:18

I\'d like to invoke a mailto link from JavaScript - that is I\'d like a method that allows me to open the email client on the users PC, exactly as if they had clicked on a n

4条回答
  •  长情又很酷
    2020-12-13 03:50

    You can avoid the blank page issue discussed above by instead using .click() with a link on the page:

    document.getElementById('mymailto').click();
    ...
    
    

提交回复
热议问题