document.all.bname.id试试这样看看
id 和 name  是一个效果的
只不过是xml 里面不认识name ,所以出了id

解决方案 »

  1.   

    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><body>
    <input type=radio name=a id=a1 checked>
    <input type=radio name=a id=a2 > 
    <input type=radio name=a id=a3 >
    <input type=button value=test onclick="alert(getCheckedCheckbox('a').outerHTML)">
    </body></html>
    <script language=javascript>
    /**
    * This function is to get the checked checkbox.
    * JK 2003-12-08
    */
    function getCheckedCheckbox(nameOfCheckBox)
    {
    var theNum=0;
    var theCheckboxInputs=document.getElementsByName(nameOfCheckBox);
    for (var i=0;i<theCheckboxInputs.length;i++)
    {
    if(theCheckboxInputs[i].checked) return theCheckboxInputs[i];
    }
    return theNum;
    }</script>
      

  2.   

    if (document.getElementById('c1').checked) {}
       if (document.getElementById('c2').checked) {}
       if (document.getElementById('c3').checked) {}
      

  3.   

    if (document.getElementById('c1').checked) {
    alert("选中1");
    }
       if (document.getElementById('c2').checked) {
    alert("选中2");
    }
       if (document.getElementById('c3').checked) {
    alert("选中3");}<input type=radio name=a id=c1>
    <input type=radio name=a id=c2 > 
    <input type=radio name=a id=c3 >
      

  4.   

    <input type=name=a id=c1>
    document.all.a
    document.all.c1
    document.getElementById('a')
    document.getElementById('c1')
    都可以得到这个radio
      

  5.   

    <input type=radio name=a id=c1>