Reputation: 1
I am making a program and I made a text area
document.write('<textarea id="text1" rows="10" cols="50"></textarea>')
I need to save the users input to a variable but no matter what I do it wont work. Instead of the users text it, just says HTML Text Area
What do I do?
Upvotes: 0
Views: 102
Reputation: 1
You should get the DOM Element first like var textarea = document.getElementById('yourTextArea')
then get the value by textarea.value
Upvotes: 0