0
can't answer this question
var arr = . getElementsByTagName(" "); for(var x=0; x<arr.length; x++) { arr[ ].innerHTML="SoloLearn"; }
13 Respuestas
+ 7
1st blank=document
2nd blank=p
3rd blank=x
+ 5
First, it's JavaScript, not html, but never mind.
The code searches and collects all elements in html page having the specified tag name that you pass to the getElementsByTagName() function. I noticed the tag name is empty string, not sure what you mean by that.
The matching elements are stored in an array variable named var. Next the code iterates through the array (of elements) changing each of their text to "Sololearn". The iteration is also missing iterator inside the loop, so it should've been like:
for(var x=0; x<arr.length; x++)
{
arr[x].innerHTML="SoloLearn";
}
Hth,
+ 3
1st blank = div
2nd blank = 2
+ 2
1st ->document
2nd->p
3rd->x
+ 2
answer:
1st blank= document
2nd blank= p
3rd blank= x
Thankyou
+ 1
var arr =
document
.
getElementsByTagName("
p
");
for(var x=0; x<arr.length; x++)
{
arr[
x
].innerHTML="SoloLearn";
}
+ 1
1st blank-->div
2nd blank-->x
+ 1
1st blank="div"
3rd element=2
+ 1
1st blank=>img
2nd blank=>length
3rd blank=>src
No shitty
+ 1
document
p
x
+ 1
div and 2
+ 1
div
2
0
var arr = document.getElementsByTagName("img");
for(var x=0; x<arr.length; x++) {
arr[x].length = "demo.jpg";
}