The .val() property of an element in jQuery for a <textarea> does not seem to work with newlines. I need this function, since the text area is designed to recognize the enter key and display it as a preview with a new line in measure.
However, what happens is shown in this script: http://jsfiddle.net/GbjTy/1/ . The text is displayed, but not in a new line.
How can I get a preview to include newlines, and I know that this is possible because it does this in a preview of Post Post Post.
Thanks.
PS I saw other links to SO related to this, but everyone says that the end user can use some kind of code, which is not an ideal method for me. How can I achieve this if the End User does not write any specific code, like here, in the SO Preview Preview, where Enter works as it should in the preview.
jquery html newline textarea enter
H bellamy
source share