The textarea element represents a multiline plain text edit control for the element's raw value.
For historical reasons, the element's value is normalized in three different ways for three different purposes.
The raw value is the value as it was originally set. It is not normalized.
The API value is the value used in the
textLengthIDL attribute, and by the
minlengthcontent attributes. It is normalized so that line breaks use U+000A LINE FEED (LF) characters.
Finally, there is the value, as used in form submission and other processing models in this specification. It is normalized so that line breaks use U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pairs, and in addition, if necessary given the element's
wrapattribute, additional line breaks are inserted to wrap the text at the given width.
All info above is copied from HTML Standard.
So for eaxmple,
you get the API value, when using
value is submitted to server when posting a form, using
\r\nas the line break, which is consistent with what's used in an HTTP message;
and there is no way to retrieve the raw value.