✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
What will be the output of the following JavaScript code?
function totalelements()
{
var allgenders=document.getElementsByName("gender");
alert("Total Genders:"+allgenders.length);
}
<form>
<input type="radio" name="gender" value="male">
<input type="radio" name="gender" value="female">
<input type="button" onclick="totalelements()" value="Total Genders">
</form>
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!