Error: Can not read property 'elements' of undefined

0

I have the following problem:

  

Can not read property 'elements' of undefined

When I try to do this:

for(var i=0;i<168;i++){
   for(var j=0;j<4;j++){    
      // aquí el error, Necesito obtener el name del radioBUtton de forma dinámica.   
      var a=document.forms[i].elements[j].name; 
   }
}

How can I get the name of a radiobutton for this case?

Thank you.

    
asked by KeyWords 10.12.2018 в 18:30
source

0 answers