最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Cursor position in html mailto link - Stack Overflow

programmeradmin0浏览0评论

When using the additional parameters in a mailto:// hyperlink, the cursor is placed at the start of the message. Is it possible to set the starting position of the cursor to another location in the body text?

For example, consider the following HTML:

<a href="mailto://[email protected]?subject=Hello&body=Hello,%0D%0A%0D%0A%0This%20is%20an%20additional%20line%20of%20text...">Click Here To Email Me</a>

Clicking on the link will launch the end-user's default email client and (if the client supports it) will pre-populate the to field with [email protected], the subject field with Hello and the body field with:

Hello,

This is an additional line of text...

The default positioning of the cursor (i.e. in OS X Mail.app) is at the beginning of the body, before the word "Hello".

How can the cursor be positioned after the ellipses, so the end-user can finish the message? Is that even possible?

When using the additional parameters in a mailto:// hyperlink, the cursor is placed at the start of the message. Is it possible to set the starting position of the cursor to another location in the body text?

For example, consider the following HTML:

<a href="mailto://[email protected]?subject=Hello&body=Hello,%0D%0A%0D%0A%0This%20is%20an%20additional%20line%20of%20text...">Click Here To Email Me</a>

Clicking on the link will launch the end-user's default email client and (if the client supports it) will pre-populate the to field with [email protected], the subject field with Hello and the body field with:

Hello,

This is an additional line of text...

The default positioning of the cursor (i.e. in OS X Mail.app) is at the beginning of the body, before the word "Hello".

How can the cursor be positioned after the ellipses, so the end-user can finish the message? Is that even possible?

Share Improve this question edited Oct 3, 2014 at 6:29 jeffjenx 17.5k6 gold badges62 silver badges103 bronze badges asked Oct 10, 2013 at 0:31 user2353513user2353513 1892 silver badges12 bronze badges 1
  • 3 Nominating to re-open. It's very clear what this person is asking. – Brad Commented Oct 10, 2013 at 12:38
Add a ment  | 

2 Answers 2

Reset to default 9

It is not possible.

When you click on any "mailto:" link, the browser will handle the request to any E-mail application, either a Desktop application like - Microsoft Outlook, Mozilla Thunderbird etc. or another browser tab like GMail.

In the "mailto:" link, we can set only the to, subject etc. But not any other information regarding the cursor position.

This is not possible. You don't have that level of control.

In fact, you can't even set the body and subject line for many e-mail clients.

发布评论

评论列表(0)

  1. 暂无评论