How to click a mailto link in JQuery

Waqas Anwar
19 August 2014
2920 Views

If you have a mailto link on the page and you want to invoke a click event using JQuery you can use the following code snippet. 

Suppose here is the link 
<a id='mylink' href="mailto:waqas@ezzylearning.com">Email</a>
Use following JQuery code for invoking click event on the above link 
$("#mylink").bind('click', function () {
   window.location.href = $(this).attr('href');
});

$("[id$='_lnkTDEmailAddress']").click();