I want to take the contents of a text field and put it in <pre>. The problem is that if I set innerHTML -property to the value before textarea, all tabs and lines will be deleted in Internet Explorer. If I use innerText instead of innerHtml, I will get line breaks, but the tabs will still disappear. Works great in other browsers.
<pre>
Is there a solution for this?
Create the DOM node text:
pre.innerHTML= ''; pre.appendChild(document.createTextNode('A\tB\r\nC'));
Windows (\r\n) ( DOM , \n), - IE.
\r\n
\n
Source: https://habr.com/ru/post/1759149/More articles:Print your entire Xcode project in pdf format for documentation - xcodeTemplates for multiple Grails templates in one application - templatesCan a thread context class loader be null? - javaTesla double precision - doubleTFS2010 Online Client Access - tfsUsing Usage with Typed Dataset Table Adapters - c #How can I save Subversion commit messages during merges? - mergeQuestion about threads and locks - javaSQL Server: how to determine what will break when overriding a database? - sql-serverAndroid: how to cancel / abort / abort SQLite query? - androidAll Articles