logo

Crowdly

What will be the output of the following JavaScript code? function totalelem...

✅ 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>

More questions like this

Want instant access to all verified answers on e-learning.msa.edu.eg?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!