title: Remove line-breaks and spaces from textarea
body: <pre><code>&lt;textarea rows='5' cols='50' id='content'&gt;&lt;/textarea&gt;
  &lt;input type='button' value='Extract Text' onclick='someFunction()'/&gt;
  </code></pre>
  
  <p>Assume these two html elements. My problem is the following: </p>
  
  <p>Let's say that the user enters into the textarea field something like this, exactly as typed. With all line breaks and spaces. (And yes, this is Python :P)</p>
  
  <pre><code>if (...):  
     print "Hello everyone!"
  else:
     print "Dudes help me out!"
  </code></pre>
  
  <p>My objective is to make a JavaScript function which removes all the spaces and line breaks (typed with 'Enter') and returns a space-less string. Something like "ThisIsASampleText". I've used <code>document.getElementById('content').value</code> and <code>myString.replace(/\s+/g, '')</code> to remove spaces. Can't make it work. Any ideas? </p>
  
  <p>Best Regards</p>