请告诉我如何在 JavaScript 中换行。
<input type='submit' name='Submit' value='Submit'
onClick="parent.location='mailto:[email protected]?subject=Thanks for writing to me &body=I will get back to you soon. Thanks and Regards Saurav Kumar'">
我想在主题中添加换行符。我需要的输出是:
I will get back to you soon
Thanks and Regards
Saurav Kumar
Add %0D%0A
到您想要在 URL 上编码换行符的任何位置。
这是 Windows 机器上的新行序列,虽然在 Linux 和 Mac 上不一样,但应该适用于两者。
如果你想在实际的 javascript 中换行,请使用\n
转义序列。
onClick="parent.location='mailto:[email protected]?subject=Thanks for writing to me &body=I will get back to you soon.%0D%0AThanks and Regards%0D%0ASaurav Kumar'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)