MCQ
Single Best Answer
Easy
QWhat would the following JavaScript code produce?
1
2
3
function myFunction()
{
var l = document.getElementsByTagName("P").length;
alert(l);
}
1
2
3
function myFunction() { var l = document.getElementsByTagName("P").length; alert(l); }
ID: #5098
Javascript DOM & Event Handling MCQ
128 views
Question Info
#5098Q ID
EasyDifficulty
Javascript DOM & Event Handling MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option C
Explanation
The HTMLCollection's length property returns the number of elements it contains.
When you wish to iterate through an HTMLCollection, this element is helpful.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic