My problem is simple. I am trying to replace all the <br/> characters from a string by \n and display all the resulted string in a <textarea> element.
CODE:
textarea.innerHTML = s.innerHTML.replace(/(\r\n|[\r\n])/g, '').replace(/<br[\s\/]?>/gi, '\n');
Inside the textarea, I should see separated lines by “\n”.
It works in any browsers, including IE6, but not in IE9. What is wrong? Thanks!
Try to use
valueproperty oftextarea, notinnerHTML.