Not sure how you are setting the textarea content, but if you use the jQuery val
method, \n
works consistently in Firefox and IE (Including IE8):
var txt = $("textarea#idhere");
txt.val( txt.val() + "\nSomething here\n\nAgain");
Causes the textarea to display:
Existing content
and linebreaks if any.
Something hereAgain
You can see a demo here that works in FF and IE8: Demo | Source
Related Contents:
- Set value of textarea in jQuery
- val() vs. text() for textarea
- Cursor position in a textarea (character index, not x/y coordinates)
- Count characters in textarea
- Insert text into textarea with jQuery
- jQuery using append with effects
- Append text to input field
- jQuery autocomplete for dynamically created inputs
- append /remove anchor name from current url without refresh
- jQuery append Google Adsense to div
- jQuery: append() object, remove() it with delay()
- How to change color of SVG image using CSS (jQuery SVG image replacement)?
- jQuery click event not working after adding class
- Jquery Ajax Posting JSON to webservice
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- Update Angular model after setting input value with jQuery
- jQuery Deferred – waiting for multiple AJAX requests to finish [duplicate]
- Find a string of text in an element and wrap some span tags round it
- JQuery: Remove duplicate elements?
- SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3
- Randomize a sequence of div elements with jQuery
- Adding event listeners to dynamically added elements using jQuery [duplicate]
- Using jQuery To Get Size of Viewport
- What’s the difference between jQuery’s replaceWith() and html()?
- jQuery validator and a custom rule that uses AJAX
- How to change an element’s title attribute using jQuery
- How can I show and hide elements based on selected option with jQuery?
- jQuery and MooTools Conflict
- jqGrid custom format fails on addClass
- Button text toggle in jquery
- Detect middle button click (scroll button) with jQuery
- jqgrid showLink
- jQuery :first vs. .first()
- jquery, add/remove class when window width changes
- $(window).unload is not firing
- Django JQuery Ajax File Upload
- override jquery validate plugin email address validation
- Showing random divs using Jquery
- Disable specific days of the week on jQuery UI datepicker [duplicate]
- What are the significant differences among $(sel).bind(“click”, $(sel).click(, $(sel).live(“click”, $(sel).on(“click”?
- Jquery resizing image
- Extracting Ajax return data in jQuery
- jQuery validate plugin : accept letters only?
- What’s the difference between class and id in jQuery?
- How to read line by line of a text area HTML tag
- jQuery DataTables: control table width
- jQuery autohide element after 5 seconds
- How do I select a sibling element using jQuery?
- Merge values from two forms on submit
- How do you change the default widget for all Django date fields in a ModelForm?