javascript: get contents of textarea, textContent vs. innerHTML vs. innerText
问题 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. html <textarea id="productdescript">test copy..asdfd</textarea><button value="Enter" onclick="addProduct()"> js function addProduct() { var descript = document.getElementById('productdescript').textContent; alert(descript); } Firefox is the only browser I have currently. When I use textContent, the alert box