function checkall(){
var hobby = document.getElementsByTagName("input");
for(var i=0; i<hobby.length;i++){
hobby[i].checked = true;
}
// 任务1
// 任务2
}
function clearall(){
var hobby = document.getElementsByName("hobby");
for(var j=0; j<hobby.length;j++){
hobby[i].checked = false;
}
变量不一致,把hobby[i].checked = false;的[i]改成[j]