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
This are your code?
you write document.getElementByID....
and the "D" should be written lowercase "d"
document.getElementById('productdescript').textContent;
For textarea
, you could only use .value
in your scenario (I tested your given code and it works fine).
.
Also,
1) keep in mind that you call this function addProduct()
ONLY after your element is mentioned in the code, otherwise it will be undefined
.
2) there must not be another element with id as productdescript
3) there must not be a JS variable
called productdescript