How to get the data of textarea tag?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to get the data of textarea tag??

15th Jun 2022, 9:15 AM
Mihir Lalwani
Mihir Lalwani - avatar
5 Answers
+ 2
It does work. https://code.sololearn.com/WKfnsNj6k9FV/?ref=app If the problem is something else, please link your code and specify the issue.
15th Jun 2022, 12:41 PM
Lisa
Lisa - avatar
+ 3
Just the same as for other input tags: By reading the value property. https://www.w3schools.com/jsref/prop_textarea_value.asp You can easily find it out, if you only put a little effort in a quick Google search.
15th Jun 2022, 9:54 AM
Lisa
Lisa - avatar
+ 2
<!---html--> <textarea>Coding is fun</textarea> /**JavaScript**/ const text = document.querySelector("textarea").value; console.log(text);
15th Jun 2022, 11:04 AM
Emms
Emms - avatar
+ 2
Both methods are not working..
15th Jun 2022, 12:15 PM
Mihir Lalwani
Mihir Lalwani - avatar
+ 1
Lisa thanks...
28th Jun 2022, 8:17 AM
Mihir Lalwani
Mihir Lalwani - avatar