请大家帮忙看看代码哪里不对,怎么无效呢?谢谢了!
function checkall(){
var hobby = document.getElementsByTagName("input");
for(var i=0;i<hobby.length;i++)
{
if (hobby[i].type == "checkbox")
{
hobby[i].checked = true;
}
}
}
function clearall()
{
var b = document.getElementsByName("hobby");
for(var i=0;i<hobby.length;i++)
{
b[i].checked = false;
}
}
function checkone(){
var c=document.getElementById("wb").value;
var d=document.getElementsByName("hobby");
if(parseInt(c)>=0||parseInt(c)<7)
{
d[parseInt(c)-1].checked = ture;
}
else
{
alert("请输入1-7之间的整数!");
}
}