carriage return in textarea retrieved as line feed

主宰稳场 提交于 2019-12-01 21:09:28
Arglanir

According to W3C Textarea api value, it seems that when invoking the .value attribute of textarea, any carriage return or line feed is transformed into a LINE FEED (10) character (in fact W3C says CRFL but it seems the browsers prefer only LF) - so a script can be platform-independent on line feeds.

In a form data, it seems that the fine feeds are transformed into CRLF (13+10).

W3C speaks also about a raw value but it's probably internal to any javascript engine and it seems it's not available in Javascript.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!