获得动态生成radio或checkbox的选中值

<script>
    function qqq() {
for(var a=1;a<document.getElementById("Table1").rows.length;a++)
{
    var cc=document.getElementById("Table1").rows[a].cells[2].getElementsByTagName("input");
    if(cc[0].checked)
    {
alert(cc[0].type);
    }
   
        var cc=document.getElementById("Table1").rows[a].cells[3].getElementsByTagName("input");
    if(cc[0].checked)
    {
alert(cc[0].type);
    }


}
}
</script>

其中cells[2]为checkbox,cells[3]为radio,第一个函数弹出checkbox,第二个弹出radio

原文地址:https://www.cnblogs.com/windphoenix/p/1647649.html