循环判断,用名字区分
.cehecked==false/true

解决方案 »

  1.   

    写一个方面的,另外类似function test()
    {
        var i,count = 0;
        var check1 = document.getElementsByName("aa");
        for (i = 0; i < check1.length; i++)
        {
            if (check1[i].checked == true)
                count ++;                
        }
        if (count == 0)
        {    
            alert("please select one!");
            return false;
        }        
            
    }
      

  2.   

    不行,我把所有的都选择上了还是会说“please select one”,我需要的是没有选择一项才跳出错误,选择了一项就不必出现错误。
      

  3.   

    aa是HTML控件的名字, 
    <html>
    <body>
    <input type=checkbox name=aa>
    </body>
    </html>