Single Choice
Easy
QWhat would the following JavaScript code produce?
function counth2()
{
var totalh2=document.getElementsByTagName("h2");
alert("totalh2.length);
}
hello
hello
hello
hello
ID: #5084
Javascript DOM & Event Handling MCQ
141 views
Question Info
#5084Q 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
Explanation
All elements with the supplied tag name are returned by the document.getElementsByTagName() function.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic