title: javascript: get contents of textarea, textContent vs. innerHTML vs. innerText
body: <p>I am having trouble getting the contents of a textarea with js.  I feel like I've done this many times before without problems but something is throwing it off or I have a mental block.</p>
  
  <p>html</p>
  
  <pre><code>&lt;textarea id="productdescript"&gt;test copy..asdfd&lt;/textarea&gt;&lt;button value="Enter" onclick="addProduct()"&gt;
  </code></pre>
  
  <p>js</p>
  
  <pre><code>function addProduct() {
  var descript = document.getElementById('productdescript').textContent;
  alert(descript);
  }
  </code></pre>
  
  <p>Firefox is the only browser I have currently.</p>
  
  <p>When I use textContent, the alert box appears but it is blank.
  When I use value, the alert box appears and says "Undefined"
  When I use innerHTML, all the HTML appears including the  tags.</p>
  
  <p>Also, I understand that textContent only runs in FF and for cross browser compatibility you need to do something like innerText and textContent but textContent is not working in FF.  There is no jquery on this app</p>
  
  <p>What is the correct cross browser way to get contents of textarea!  Thanks for any suggestions.</p>