Value from textarea returns nothing 😱 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Value from textarea returns nothing 😱

I tried to get the value from the textarea and write in the div. https://code.sololearn.com/Wk3oLBnDhK2T/?ref=app But it doesn't show anything. How to fix it please

13th Dec 2020, 8:04 AM
Prasant
Prasant - avatar
2 Answers
+ 3
Prasant : The Nothing 😜🙈 It is happening because you are getting textarea value before loading the document. So you need to get value when event occurs. Write this inside the function var txt = document.getElementById("txt").value; var dv = document.getElementById("dv"); See this https://code.sololearn.com/Whh4UL3C1hIO/?ref=app
13th Dec 2020, 8:16 AM
A͢J
A͢J - avatar
+ 2
I Am Groot ! Thank you so much 😊
13th Dec 2020, 9:02 AM
Prasant
Prasant - avatar