title: Javascript replace whitespace with new line
body: <p>Is it possible in javascript to replace all whitespaces in </p>
  
  <p><code>&lt;input name="product_description[2][name]&gt;"</code></p>
  
  <p>and turn them into line breaks and show them in </p>
  
  <p><code>&lt;textarea name="product_description[2][meta_keyword]"&gt;</code></p>
  
  <p>I am trying this </p>
  
  <pre><code>function getElements()
  {
  var text = document.getElementsByName('product_description[2][name]').value;
  var out = document.getElementsByName('product_description[2][meta_keyword]').value;}
  function makelinebreaks(){
  text = text.split(" ").join("\n")
  out = text;}
  </code></pre>