开发者

Hyperlink activated directly from button rather than underlined text

开发者 https://www.devze.com 2023-03-23 11:49 出处:网络
For styling purposes, would like to activate Outlook Express, or whatever, directly from clicking a button, rather than clicking a button which causes \"Click here 开发者_JAVA技巧to send Email\" to be

For styling purposes, would like to activate Outlook Express, or whatever, directly from clicking a button, rather than clicking a button which causes "Click here 开发者_JAVA技巧to send Email" to be displayed and then clicking "Click here to send Email".

Suggestions as to how to achieve objective will be appreciated.

Thank you.

Ivan Rutter


Something like this ?

html

<button class="email" data-email="some@email.com">whatever</button>

jquery

$('.email').click(function(){
   window.location = 'mailto:' + $(this).data('email');
});


Do you mean

<input type="button" value="Send Mail" onclick="location='mailto:whoever@wherever.com';" />


<a href="mailto:my.name@example.com">Mail me!</a>

Clicking this link will automatically open the system's default e-mail client. See here for more details on mailto: http://www.ianr.unl.edu/internet/mailto.html.

Edit: if you want it to look like a button, stick a button-like image in your <a>.

0

精彩评论

暂无评论...
验证码 换一张
取 消