Attach event listener through javascript to radio button

前端 未结 5 805
春和景丽
春和景丽 2020-12-03 08:13

I have several radio buttons with the same name. Like this:

5条回答
  •  被撕碎了的回忆
    2020-12-03 08:40

    for(var property in object) { ... } 
    

    is used to loop in objects to find properties. for array you can use normal for loop

    for(var i=0; i< radios.length; i++) {
         var radio = radios[i];
         ....
    } 
    

提交回复
热议问题