Value from textarea returns nothing šŸ˜± | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Respostas
+ 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