<script type="text/javascript">
function checkall(){
var hobby=document.getElementsByTagName("input");
for(var i=0;i<=hobby.length;i++){
hobby[i].checked=true;
}
} //任务一
function clearall(){
var hobby=document.getElementsByName("hobby");
for(var i=0;i<=hobby.length;i++){
hobby[i].checked=false;
}
} //任务二
function checkone(){
var j=document.getElementById("wb").value;
var hobby=document.getElementsByName("hobby");
var num=j.split("");
for(var i=0;i<hobby.length;i++){
hobby[num[i]-1].checked=true;
}
} //任务三
function clearone(){
var j=document.getElementById("wb").value;
var hobby=document.getElementsByName("hobby");
var num=j.split("");
for(var i=0;i<hobby.length;i++){
hobby[num[i]-1].checked=false;
}
}
</script>