title: Formatting JSON in a textarea
body: <p>I have a page where I want to let the user edit an application - stored in a JSON. It looks like this:</p>
  
  <pre><code>{"address":{"House_Number":505,
  "Street_Direction":"",
  "Street_Name":"Claremont",
  "Street_Type":"Street",
  "Apt":"15L",
  "Burough":"Brooklyn",
  "State":"NY",
  "Zip":"10451",
  "Phone":"718-777-7777"},
  "casehead":0,
  "adults":[{"Last_Name":"Foo",
  "First_Name":"A",
  "Sex":"M",
  "Date_Of_Birth":"01011980"}],
  "children":[]}
  </code></pre>
  
  <p>I am setting this using</p>
  
  <pre><code>var pattern = ",", re = new RegExp(pattern, "g");
    casedetails.innerHTML = JSON.stringify(apps[0]).replace(re , ",&amp;#10;");
  </code></pre>
  
  <p>The problem is after I make changes, the first time I run this, the textarea doesn't show the newlines - even though they are there! (If I copy/paste they show up). If I refresh it shows the newlines.</p>
  
  <p>Can anyone help me figure out how to get JSON on new lines without having to refresh? I am using IE 9</p>
  
  <p>Thanks!</p>
  
  <p>-Tom</p>