简体   繁体   中英

Line break inside HTML tag attribute value

How can I insert line breaks inside HTML attribute values, like this:

<href="mailto:info@example.com?subject=TestMail&body=Please enter the following details.
Name
Email
Mob No">

When the user replies, the body part should display as below:

Please enter the following details.
1. Name
2. Email
3. Mob No

I tried using <br> tags, but they get displayed.

The line break should be URL encoded into %0D%0A

Your mailto will look like:

    <a href="mailto:xxx@example.com?subject&body=1.Name%0D%0A2.Email">mailme</a>

Info from http://www.cubetoon.com/2008/how-to-enter-line-break-into-mailto-body-command/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM