0
Where is my mistake?
function setText() { var a = document.getElementById("demo"); var arr = a.childNodes; for (var x=0; x<arr.length;x++){ arr[0].innerHTML = "its me" } } setTimeout(setText(), 120)
5 odpowiedzi
+ 2
In the last line....
You no need to put parenthesis after function name...
+ 1
Can you tell what error are you getting?
+ 1
Recheck the loop, you always use 0 (zero) as element index there. I'm guessing you meant to pass <x> instead like this 👇
arr[x].innerHTML = "it's me";
(Corrected - Thanks to Ja Play)
+ 1
I think it should be
arr[x].innerHTML = „its me“;