How can i make a paragraph or text clear in javascript? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8

How can i make a paragraph or text clear in javascript?

i set innerHTML of paragraph object to "" but it gives me an error that i can't give value to null type. why my paragraph object is null type? i also gave a value after i defined the object of paragraph but it still gives me the same error.

7th Apr 2017, 7:29 PM
Yazdan Hamidi
Yazdan Hamidi - avatar
4 Answers
+ 8
it's in one of my codes called omega. line 140. i have to put script in html because when i put the codes in js console it gives that error and won't work.
7th Apr 2017, 8:08 PM
Yazdan Hamidi
Yazdan Hamidi - avatar
+ 7
thanks it was helpful!
7th Apr 2017, 8:23 PM
Yazdan Hamidi
Yazdan Hamidi - avatar
+ 1
it is happen when you try to change element which not load yet. you need to change innerHTML after full load of page.
7th Apr 2017, 8:19 PM
xec
0
please attach your code.
7th Apr 2017, 8:03 PM
xec