MCQ
Single Best Answer
Easy
QWhat would the following JavaScript code produce?
function totalelements()
{
var allgenders=document.getElementsByName("gender");
alert("Total Genders:"+allgenders.length);
}
ID: #5083
Javascript DOM & Event Handling MCQ
111 views
Question Info
#5083Q 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
All elements with the supplied name are returned by the document.getElementsByName() function. The code stated above counts all of the output specified in the form.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic