How to click a mailto link in JQuery

Waqas Anwar
19 August 2014

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="">Email</a>
Use following JQuery code for invoking click event on the above link 
$("#mylink").bind('click', function () {
   window.location.href = $(this).attr('href');