+ 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