Similar Question:
Issue with new line preservation in .val() method for textarea
I'm facing an issue where my text area does not preserve newlines when I enter a message with multiple lines. Even after retrieving the value from the text area, the content appears as one continuous line. This problem is occurring across IE 9, Mozilla, Opera, and Safari browsers. How can I ensure that newlines are maintained within the text area?
var message = $(".chatpaneltext textarea").attr("value");